Skip to content

Commit e11989c

Browse files
committed
New Feature: BSToaster see https://blazorstrap.io/V5/components/toast
Fixes: Inputs outside of edit contexts
1 parent c51d0c9 commit e11989c

75 files changed

Lines changed: 684 additions & 60 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/V5/_content/BlazorStrap/blazorstrap.js

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,50 @@ if (!Element.prototype.closest) {
1717
return null;
1818
};
1919
}
20-
2120
window.blazorStrap = {
21+
ToastTimer: function(element, time, timeRemaining, rendered)
22+
{
23+
if(rendered === false)
24+
{
25+
element.classList.add("showing");
26+
}
27+
if(time === 0)
28+
{
29+
30+
setTimeout(function (){
31+
element.classList.remove("showing");
32+
},100)
33+
}
34+
if(time !== 0) {
35+
36+
const dflex = element.querySelector(".d-flex");
37+
const wrapper = document.createElement("div");
38+
wrapper.className = "w-100 p-0 m-0 position-relative border-bottom-1 border-dark";
39+
wrapper.style.top = "-1px";
40+
const timeEl = document.createElement("div")
41+
wrapper.appendChild(timeEl);
42+
element.insertBefore(wrapper, dflex);
43+
timeEl.classList.add("bg-dark");
44+
timeEl.style.height = "4px";
45+
timeEl.style.opacity = ".4";
46+
if (timeRemaining === 0) {
47+
timeEl.style.width = "0";
48+
timeEl.style["transition"] = "linear " + (time - timeRemaining) / 1000 + "s";
49+
timeEl.style["-webkit-transition"] = "linear " + (time - timeRemaining) / 1000 + "s";
50+
} else {
51+
timeRemaining = time-timeRemaining;
52+
console.log(((timeRemaining / time) * 100));
53+
timeEl.style.width = ((timeRemaining / time) * 100) + "%";
54+
timeEl.style["transition"] = "linear" + (time - timeRemaining) / 1000 + "s";
55+
timeEl.style["-webkit-transition"] = "linear " + (time - timeRemaining) / 1000 + "s";
56+
}
57+
58+
setTimeout(function () {
59+
element.classList.remove("showing");
60+
timeEl.style.width = "100%";
61+
}, 100);
62+
}
63+
},
2264
EventHandlers: [],
2365
AddEvent: async function (id, name, type, isDocument = false, ignoreChildren = false, filter = "") {
2466
return new Promise(function (resolve) {

docs/V5/_content/BlazorStrap/blazorstrap.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
4 KB
Binary file not shown.
1.42 KB
Binary file not shown.
1.29 KB
Binary file not shown.
3.2 KB
Binary file not shown.
0 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.
5 Bytes
Binary file not shown.
-3 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)