From dda97a4bb5405dcfb7d5b9a216a1c519769325d2 Mon Sep 17 00:00:00 2001 From: mickelsonmichael Date: Sat, 16 Jan 2021 10:32:36 -0700 Subject: [PATCH 1/3] Remove ?? operator --- js/js-snackbar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/js-snackbar.js b/js/js-snackbar.js index 832fcf2..0c4438f 100644 --- a/js/js-snackbar.js +++ b/js/js-snackbar.js @@ -227,7 +227,7 @@ function SnackBar(userOptions) { _Options.fixed = userOptions.fixed; } - _Options.position = userOptions.position ?? _OptionDefaults.position; + _Options.position = userOptions.position ? _userOptions.position : _OptionDefaults.position; } From c7632c284686db5c61fdd12d272c8caceaaef656 Mon Sep 17 00:00:00 2001 From: mickelsonmichael Date: Sat, 16 Jan 2021 10:32:44 -0700 Subject: [PATCH 2/3] Update minified files --- css/js-snackbar.min.css | 2 +- js/js-snackbar.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/css/js-snackbar.min.css b/css/js-snackbar.min.css index 0f95df9..92e42d8 100644 --- a/css/js-snackbar.min.css +++ b/css/js-snackbar.min.css @@ -1 +1 @@ -.js-snackbar-container{position:absolute;bottom:0;right:0;display:flex;flex-direction:column;align-items:flex-end;max-width:100%;padding:10px;overflow:hidden}.js-snackbar-container--fixed{position:fixed}.js-snackbar-container *{box-sizing:border-box}.js-snackbar__wrapper{overflow:hidden;height:auto;margin:5px 0;transition:all ease .5s;border-radius:3px;box-shadow:0 0 4px 0 #000}.js-snackbar{display:inline-flex;box-sizing:border-box;border-radius:3px;color:#eee;font-size:16px;background-color:#262626;vertical-align:bottom}.js-snackbar__close,.js-snackbar__message,.js-snackbar__status{position:relative}.js-snackbar__message{padding:12px}.js-snackbar__status{display:none;width:15px;margin-right:5px;border-radius:3px 0 0 3px;background-color:transparent}.js-snackbar__status.js-snackbar--danger,.js-snackbar__status.js-snackbar--info,.js-snackbar__status.js-snackbar--success,.js-snackbar__status.js-snackbar--warning{display:block}.js-snackbar__status.js-snackbar--success{background-color:#4caf50}.js-snackbar__status.js-snackbar--warning{background-color:#ff9800}.js-snackbar__status.js-snackbar--danger{background-color:#b90909}.js-snackbar__status.js-snackbar--info{background-color:#2196f3}.js-snackbar__action{display:flex;align-items:center;padding:0 10px;color:#838cff;cursor:pointer}.js-snackbar__action:hover{background-color:#333}.js-snackbar__close{cursor:pointer;display:flex;align-items:center;padding:0 10px;user-select:none;color:#bbb}.js-snackbar__close:hover{background-color:#444} \ No newline at end of file +.js-snackbar-container{position:absolute;bottom:0;right:0;display:flex;flex-direction:column;align-items:flex-end;max-width:100%;padding:10px;z-index:999;overflow:hidden}.js-snackbar-container--top-left{bottom:unset;right:unset;top:0;left:0}.js-snackbar-container--top-right{bottom:unset;right:0;left:unset;top:0}.js-snackbar-container--bottom-left{bottom:0;right:unset;left:0;top:unset}.js-snackbar-container--fixed{position:fixed}.js-snackbar-container *{box-sizing:border-box}.js-snackbar__wrapper{overflow:hidden;height:auto;margin:5px 0;transition:all ease .5s;border-radius:3px;box-shadow:0 0 4px 0 #000}.js-snackbar{display:inline-flex;box-sizing:border-box;border-radius:3px;color:#eee;font-size:16px;background-color:#262626;vertical-align:bottom}.js-snackbar__close,.js-snackbar__message,.js-snackbar__status{position:relative}.js-snackbar__message{padding:12px}.js-snackbar__status{display:none;width:15px;margin-right:5px;border-radius:3px 0 0 3px;background-color:transparent}.js-snackbar__status.js-snackbar--danger,.js-snackbar__status.js-snackbar--info,.js-snackbar__status.js-snackbar--success,.js-snackbar__status.js-snackbar--warning{display:block}.js-snackbar__status.js-snackbar--success{background-color:#4caf50}.js-snackbar__status.js-snackbar--warning{background-color:#ff9800}.js-snackbar__status.js-snackbar--danger{background-color:#b90909}.js-snackbar__status.js-snackbar--info{background-color:#2196f3}.js-snackbar__action{display:flex;align-items:center;padding:0 10px;color:#838cff;cursor:pointer}.js-snackbar__action:hover{background-color:#333}.js-snackbar__close{cursor:pointer;display:flex;align-items:center;padding:0 10px;user-select:none;color:#bbb}.js-snackbar__close:hover{background-color:#444} \ No newline at end of file diff --git a/js/js-snackbar.min.js b/js/js-snackbar.min.js index fd22c42..881dd42 100644 --- a/js/js-snackbar.min.js +++ b/js/js-snackbar.min.js @@ -1 +1 @@ -function SnackBar(t){function e(){if(null===r.container||void 0===r.container)o=document.body;else if("object"==typeof r.container&&r.container instanceof Element)a=r.container;else{var t=document.getElementById(r.container);void 0===t&&(console.error("SnackBar: Could not find target container "+r.container),t=document.body),o=t}a=m(o),a||(a=document.createElement("div"),a.classList.add("js-snackbar-container"),r.fixed&&a.classList.add("js-snackbar-container--fixed"),o.appendChild(a)),r.fixed?a.classList.add("js-snackbar-container--fixed"):a.classList.remove("js-snackbar-container--fixed"),n=document.createElement("div"),n.classList.add("js-snackbar__wrapper");var e=document.createElement("div");if(e.classList.add("js-snackbar","js-snackbar--show"),r.status){r.status=r.status.toLowerCase().trim();var d=document.createElement("span");d.classList.add("js-snackbar__status"),"success"===r.status||"green"===r.status?d.classList.add("js-snackbar--success"):"warning"===r.status||"alert"===r.status||"orange"===r.status?d.classList.add("js-snackbar--warning"):"danger"===r.status||"error"===r.status||"red"===r.status?d.classList.add("js-snackbar--danger"):d.classList.add("js-snackbar--info"),e.appendChild(d)}if(i=document.createElement("span"),i.classList.add("js-snackbar__message"),i.textContent=r.message,e.appendChild(i),void 0!==r.actions&&"object"==typeof r.actions&&void 0!==r.actions.length)for(var l=0;l=0?r.timeout=t.timeout:console.debug("Invalid timeout entered. Must be greater than or equal to 0."),r.timeout=t.timeout)),void 0!==t.status&&(r.status=t.status),void 0!==t.actions&&(r.actions=t.actions),void 0===t.container||"string"!=typeof t.container&&"object"!=typeof t.container||(r.container=t.container),void 0!==t.fixed&&(r.fixed=t.fixed))},m=function(t){var e=t.children,s=null,i=0;for(i=0;i0&&s.classList.contains("js-snackbar-container"))return s;return null};this.Open=function(){var t=n.firstElementChild.scrollHeight;n.style.height=t+"px",n.style.opacity=1,n.style.marginTop="5px",n.style.marginBottom="5px",n.addEventListener("transitioned",function(){n.removeEventListener("transitioned",arguments.callee),n.style.height=null})},this.Close=function(){s&&clearInterval(s);var t=n.scrollHeight,e=n.style.transition;n.style.transition="",requestAnimationFrame(function(){n.style.height=t+"px",n.style.opacity=1,n.style.marginTop="0px",n.style.marginBottom="0px",n.style.transition=e,requestAnimationFrame(function(){n.style.height="0px",n.style.opacity=0})}),setTimeout(function(){a.removeChild(n)},1e3)},l(),e(),c.Open()} \ No newline at end of file +function SnackBar(userOptions){var _This=this,_Interval,_Message,_Element,_Container,_Parent,_OptionDefaults={message:"Operation performed successfully.",dismissible:!0,timeout:5e3,status:"",actions:[],fixed:!1,position:"br"},_Options=_OptionDefaults;function _Create(){if(null===_Options.container||void 0===_Options.container)_Parent=document.body;else if("object"==typeof _Options.container&&_Options.container instanceof Element)_Container=_Options.container;else{var targetParent=document.getElementById(_Options.container);void 0===targetParent&&(console.error("SnackBar: Could not find target container "+_Options.container),targetParent=document.body),_Parent=targetParent}(_Container=searchChildren(_Parent))||((_Container=document.createElement("div")).classList.add("js-snackbar-container"),_Options.fixed&&_Container.classList.add("js-snackbar-container--fixed"),_Parent.appendChild(_Container)),_Options.fixed?_Container.classList.add("js-snackbar-container--fixed"):_Container.classList.remove("js-snackbar-container--fixed"),_Container.classList.add(getPositionClass()),(_Element=document.createElement("div")).classList.add("js-snackbar__wrapper");var innerSnack=document.createElement("div");if(innerSnack.classList.add("js-snackbar","js-snackbar--show"),_Options.status){_Options.status=_Options.status.toLowerCase().trim();var status=document.createElement("span");status.classList.add("js-snackbar__status"),"success"===_Options.status||"green"===_Options.status?status.classList.add("js-snackbar--success"):"warning"===_Options.status||"alert"===_Options.status||"orange"===_Options.status?status.classList.add("js-snackbar--warning"):"danger"===_Options.status||"error"===_Options.status||"red"===_Options.status?status.classList.add("js-snackbar--danger"):status.classList.add("js-snackbar--info"),innerSnack.appendChild(status)}if((_Message=document.createElement("span")).classList.add("js-snackbar__message"),_Message.textContent=_Options.message,innerSnack.appendChild(_Message),void 0!==_Options.actions&&"object"==typeof _Options.actions&&void 0!==_Options.actions.length)for(var i=0;i<_Options.actions.length;i++){var thisAction=_Options.actions[i];if(void 0!==thisAction&&void 0!==thisAction.text&&"string"==typeof thisAction.text&&(void 0!==thisAction.function&&"function"==typeof thisAction.function||void 0!==thisAction.dissmiss&&"boolean"==typeof thisAction.dissmiss&&!0===thisAction.dissmiss)){var newButton=document.createElement("span");newButton.classList.add("js-snackbar__action"),void 0!==thisAction&&"function"==typeof thisAction.function?void 0!==thisAction.dissmiss&&"boolean"==typeof thisAction.dissmiss&&!0===thisAction.dissmiss?newButton.onclick=function(){thisAction.function(),_This.Close()}:newButton.onclick=thisAction.function:newButton.onclick=_This.Close,newButton.textContent=thisAction.text,innerSnack.appendChild(newButton)}}if(_Options.dismissible){var closeBtn=document.createElement("span");closeBtn.classList.add("js-snackbar__close"),closeBtn.innerText="×",closeBtn.onclick=_This.Close,innerSnack.appendChild(closeBtn)}_Element.style.height="0px",_Element.style.opacity="0",_Element.style.marginTop="0px",_Element.style.marginBottom="0px",_Element.appendChild(innerSnack),_Container.appendChild(_Element),!1!==_Options.timeout&&(_Interval=setTimeout(_This.Close,_Options.timeout))}var _ConfigureDefaults=function(){void 0!==userOptions&&(void 0!==userOptions.message&&(_Options.message=userOptions.message),void 0!==userOptions.dismissible&&("string"==typeof userOptions.dismissible?_Options.dismissible="true"===userOptions.dismissible:"boolean"==typeof userOptions.dismissible?_Options.dismissible=userOptions.dismissible:console.debug("Invalid option provided for 'dismissable' ["+userOptions.dismissible+"] is of type "+typeof userOptions.dismissible)),void 0!==userOptions.timeout&&("boolean"==typeof userOptions.timeout&&!1===userOptions.timeout?_Options.timeout=!1:"string"==typeof userOptions.timeout&&(_Options.timeout=parseInt(userOptions.timeout)),"number"==typeof userOptions.timeout&&(userOptions.timeout===1/0?_Options.timeout=!1:userOptions.timeout>=0?_Options.timeout=userOptions.timeout:console.debug("Invalid timeout entered. Must be greater than or equal to 0."),_Options.timeout=userOptions.timeout)),void 0!==userOptions.status&&(_Options.status=userOptions.status),void 0!==userOptions.actions&&(_Options.actions=userOptions.actions),void 0===userOptions.container||"string"!=typeof userOptions.container&&"object"!=typeof userOptions.container||(_Options.container=userOptions.container),void 0!==userOptions.fixed&&(_Options.fixed=userOptions.fixed),_Options.position=userOptions.position?_userOptions.position:_OptionDefaults.position)},searchChildren=function(target){var htmlCollection=target.children,node=null,i=0,positionClass=getPositionClass();for(i=0;i0&&node.classList.contains("js-snackbar-container")&&node.classList.contains(positionClass))return node;return null};this.Open=function(){var contentHeight=_Element.firstElementChild.scrollHeight;_Element.style.height=contentHeight+"px",_Element.style.opacity=1,_Element.style.marginTop="5px",_Element.style.marginBottom="5px",_Element.addEventListener("transitioned",(function(){_Element.removeEventListener("transitioned",arguments.callee),_Element.style.height=null}))},this.Close=function(){_Interval&&clearInterval(_Interval);var snackbarHeight=_Element.scrollHeight,snackbarTransitions=_Element.style.transition;_Element.style.transition="",requestAnimationFrame((function(){_Element.style.height=snackbarHeight+"px",_Element.style.opacity=1,_Element.style.marginTop="0px",_Element.style.marginBottom="0px",_Element.style.transition=snackbarTransitions,requestAnimationFrame((function(){_Element.style.height="0px",_Element.style.opacity=0}))})),setTimeout((function(){_Container.removeChild(_Element)}),1e3)},this.getPositionClass=function(){switch(console.log(_Options.position),_Options.position){case"bl":return"js-snackbar-container--bottom-left";case"tl":return"js-snackbar-container--top-left";case"tr":return"js-snackbar-container--top-right";default:return"js-snackbar-container--bottom-right"}},_ConfigureDefaults(),_Create(),_This.Open()} \ No newline at end of file From fd74c755202207e8cfd76718861b591a45a525f6 Mon Sep 17 00:00:00 2001 From: mickelsonmichael Date: Tue, 2 Feb 2021 07:34:13 -0700 Subject: [PATCH 3/3] Fix minified JS --- js/js-snackbar.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/js-snackbar.min.js b/js/js-snackbar.min.js index 881dd42..6f8cd80 100644 --- a/js/js-snackbar.min.js +++ b/js/js-snackbar.min.js @@ -1 +1 @@ -function SnackBar(userOptions){var _This=this,_Interval,_Message,_Element,_Container,_Parent,_OptionDefaults={message:"Operation performed successfully.",dismissible:!0,timeout:5e3,status:"",actions:[],fixed:!1,position:"br"},_Options=_OptionDefaults;function _Create(){if(null===_Options.container||void 0===_Options.container)_Parent=document.body;else if("object"==typeof _Options.container&&_Options.container instanceof Element)_Container=_Options.container;else{var targetParent=document.getElementById(_Options.container);void 0===targetParent&&(console.error("SnackBar: Could not find target container "+_Options.container),targetParent=document.body),_Parent=targetParent}(_Container=searchChildren(_Parent))||((_Container=document.createElement("div")).classList.add("js-snackbar-container"),_Options.fixed&&_Container.classList.add("js-snackbar-container--fixed"),_Parent.appendChild(_Container)),_Options.fixed?_Container.classList.add("js-snackbar-container--fixed"):_Container.classList.remove("js-snackbar-container--fixed"),_Container.classList.add(getPositionClass()),(_Element=document.createElement("div")).classList.add("js-snackbar__wrapper");var innerSnack=document.createElement("div");if(innerSnack.classList.add("js-snackbar","js-snackbar--show"),_Options.status){_Options.status=_Options.status.toLowerCase().trim();var status=document.createElement("span");status.classList.add("js-snackbar__status"),"success"===_Options.status||"green"===_Options.status?status.classList.add("js-snackbar--success"):"warning"===_Options.status||"alert"===_Options.status||"orange"===_Options.status?status.classList.add("js-snackbar--warning"):"danger"===_Options.status||"error"===_Options.status||"red"===_Options.status?status.classList.add("js-snackbar--danger"):status.classList.add("js-snackbar--info"),innerSnack.appendChild(status)}if((_Message=document.createElement("span")).classList.add("js-snackbar__message"),_Message.textContent=_Options.message,innerSnack.appendChild(_Message),void 0!==_Options.actions&&"object"==typeof _Options.actions&&void 0!==_Options.actions.length)for(var i=0;i<_Options.actions.length;i++){var thisAction=_Options.actions[i];if(void 0!==thisAction&&void 0!==thisAction.text&&"string"==typeof thisAction.text&&(void 0!==thisAction.function&&"function"==typeof thisAction.function||void 0!==thisAction.dissmiss&&"boolean"==typeof thisAction.dissmiss&&!0===thisAction.dissmiss)){var newButton=document.createElement("span");newButton.classList.add("js-snackbar__action"),void 0!==thisAction&&"function"==typeof thisAction.function?void 0!==thisAction.dissmiss&&"boolean"==typeof thisAction.dissmiss&&!0===thisAction.dissmiss?newButton.onclick=function(){thisAction.function(),_This.Close()}:newButton.onclick=thisAction.function:newButton.onclick=_This.Close,newButton.textContent=thisAction.text,innerSnack.appendChild(newButton)}}if(_Options.dismissible){var closeBtn=document.createElement("span");closeBtn.classList.add("js-snackbar__close"),closeBtn.innerText="×",closeBtn.onclick=_This.Close,innerSnack.appendChild(closeBtn)}_Element.style.height="0px",_Element.style.opacity="0",_Element.style.marginTop="0px",_Element.style.marginBottom="0px",_Element.appendChild(innerSnack),_Container.appendChild(_Element),!1!==_Options.timeout&&(_Interval=setTimeout(_This.Close,_Options.timeout))}var _ConfigureDefaults=function(){void 0!==userOptions&&(void 0!==userOptions.message&&(_Options.message=userOptions.message),void 0!==userOptions.dismissible&&("string"==typeof userOptions.dismissible?_Options.dismissible="true"===userOptions.dismissible:"boolean"==typeof userOptions.dismissible?_Options.dismissible=userOptions.dismissible:console.debug("Invalid option provided for 'dismissable' ["+userOptions.dismissible+"] is of type "+typeof userOptions.dismissible)),void 0!==userOptions.timeout&&("boolean"==typeof userOptions.timeout&&!1===userOptions.timeout?_Options.timeout=!1:"string"==typeof userOptions.timeout&&(_Options.timeout=parseInt(userOptions.timeout)),"number"==typeof userOptions.timeout&&(userOptions.timeout===1/0?_Options.timeout=!1:userOptions.timeout>=0?_Options.timeout=userOptions.timeout:console.debug("Invalid timeout entered. Must be greater than or equal to 0."),_Options.timeout=userOptions.timeout)),void 0!==userOptions.status&&(_Options.status=userOptions.status),void 0!==userOptions.actions&&(_Options.actions=userOptions.actions),void 0===userOptions.container||"string"!=typeof userOptions.container&&"object"!=typeof userOptions.container||(_Options.container=userOptions.container),void 0!==userOptions.fixed&&(_Options.fixed=userOptions.fixed),_Options.position=userOptions.position?_userOptions.position:_OptionDefaults.position)},searchChildren=function(target){var htmlCollection=target.children,node=null,i=0,positionClass=getPositionClass();for(i=0;i0&&node.classList.contains("js-snackbar-container")&&node.classList.contains(positionClass))return node;return null};this.Open=function(){var contentHeight=_Element.firstElementChild.scrollHeight;_Element.style.height=contentHeight+"px",_Element.style.opacity=1,_Element.style.marginTop="5px",_Element.style.marginBottom="5px",_Element.addEventListener("transitioned",(function(){_Element.removeEventListener("transitioned",arguments.callee),_Element.style.height=null}))},this.Close=function(){_Interval&&clearInterval(_Interval);var snackbarHeight=_Element.scrollHeight,snackbarTransitions=_Element.style.transition;_Element.style.transition="",requestAnimationFrame((function(){_Element.style.height=snackbarHeight+"px",_Element.style.opacity=1,_Element.style.marginTop="0px",_Element.style.marginBottom="0px",_Element.style.transition=snackbarTransitions,requestAnimationFrame((function(){_Element.style.height="0px",_Element.style.opacity=0}))})),setTimeout((function(){_Container.removeChild(_Element)}),1e3)},this.getPositionClass=function(){switch(console.log(_Options.position),_Options.position){case"bl":return"js-snackbar-container--bottom-left";case"tl":return"js-snackbar-container--top-left";case"tr":return"js-snackbar-container--top-right";default:return"js-snackbar-container--bottom-right"}},_ConfigureDefaults(),_Create(),_This.Open()} \ No newline at end of file +function SnackBar(t) { var s, e, i, n, o, a = this, c = { message: "Operation performed successfully.", dismissible: !0, timeout: 5e3, status: "", actions: [], fixed: !1, position: "br" }, r = c; var d = function (t) { var s = t.children, e = null, i = 0, n = getPositionClass(); for (i = 0; i < s.length; i++)if (1 === (e = s.item(i)).nodeType && e.classList.length > 0 && e.classList.contains("js-snackbar-container") && e.classList.contains(n)) return e; return null }; this.Open = function () { var t = i.firstElementChild.scrollHeight; i.style.height = t + "px", i.style.opacity = 1, i.style.marginTop = "5px", i.style.marginBottom = "5px", i.addEventListener("transitioned", function () { i.removeEventListener("transitioned", arguments.callee), i.style.height = null }) }, this.Close = function () { s && clearInterval(s); var t = i.scrollHeight, e = i.style.transition; i.style.transition = "", requestAnimationFrame(function () { i.style.height = t + "px", i.style.opacity = 1, i.style.marginTop = "0px", i.style.marginBottom = "0px", i.style.transition = e, requestAnimationFrame(function () { i.style.height = "0px", i.style.opacity = 0 }) }), setTimeout(function () { n.removeChild(i) }, 1e3) }, this.getPositionClass = function () { switch (console.log(r.position), r.position) { case "bl": return "js-snackbar-container--bottom-left"; case "tl": return "js-snackbar-container--top-left"; case "tr": return "js-snackbar-container--top-right"; default: return "js-snackbar-container--bottom-right" } }, void 0 !== t && (void 0 !== t.message && (r.message = t.message), void 0 !== t.dismissible && ("string" == typeof t.dismissible ? r.dismissible = "true" === t.dismissible : "boolean" == typeof t.dismissible ? r.dismissible = t.dismissible : console.debug("Invalid option provided for 'dismissable' [" + t.dismissible + "] is of type " + typeof t.dismissible)), void 0 !== t.timeout && ("boolean" == typeof t.timeout && !1 === t.timeout ? r.timeout = !1 : "string" == typeof t.timeout && (r.timeout = parseInt(t.timeout)), "number" == typeof t.timeout && (t.timeout === 1 / 0 ? r.timeout = !1 : t.timeout >= 0 ? r.timeout = t.timeout : console.debug("Invalid timeout entered. Must be greater than or equal to 0."), r.timeout = t.timeout)), void 0 !== t.status && (r.status = t.status), void 0 !== t.actions && (r.actions = t.actions), void 0 === t.container || "string" != typeof t.container && "object" != typeof t.container || (r.container = t.container), void 0 !== t.fixed && (r.fixed = t.fixed), r.position = t.position ? _userOptions.position : c.position), function () { if (null === r.container || void 0 === r.container) o = document.body; else if ("object" == typeof r.container && r.container instanceof Element) n = r.container; else { var t = document.getElementById(r.container); void 0 === t && (console.error("SnackBar: Could not find target container " + r.container), t = document.body), o = t } (n = d(o)) || ((n = document.createElement("div")).classList.add("js-snackbar-container"), r.fixed && n.classList.add("js-snackbar-container--fixed"), o.appendChild(n)), r.fixed ? n.classList.add("js-snackbar-container--fixed") : n.classList.remove("js-snackbar-container--fixed"), n.classList.add(getPositionClass()), (i = document.createElement("div")).classList.add("js-snackbar__wrapper"); var c = document.createElement("div"); if (c.classList.add("js-snackbar", "js-snackbar--show"), r.status) { r.status = r.status.toLowerCase().trim(); var l = document.createElement("span"); l.classList.add("js-snackbar__status"), "success" === r.status || "green" === r.status ? l.classList.add("js-snackbar--success") : "warning" === r.status || "alert" === r.status || "orange" === r.status ? l.classList.add("js-snackbar--warning") : "danger" === r.status || "error" === r.status || "red" === r.status ? l.classList.add("js-snackbar--danger") : l.classList.add("js-snackbar--info"), c.appendChild(l) } if ((e = document.createElement("span")).classList.add("js-snackbar__message"), e.textContent = r.message, c.appendChild(e), void 0 !== r.actions && "object" == typeof r.actions && void 0 !== r.actions.length) for (var u = 0; u < r.actions.length; u++) { var m = r.actions[u]; if (void 0 !== m && void 0 !== m.text && "string" == typeof m.text && (void 0 !== m.function && "function" == typeof m.function || void 0 !== m.dissmiss && "boolean" == typeof m.dissmiss && !0 === m.dissmiss)) { var p = document.createElement("span"); p.classList.add("js-snackbar__action"), void 0 !== m && "function" == typeof m.function ? void 0 !== m.dissmiss && "boolean" == typeof m.dissmiss && !0 === m.dissmiss ? p.onclick = function () { m.function(), a.Close() } : p.onclick = m.function : p.onclick = a.Close, p.textContent = m.text, c.appendChild(p) } } if (r.dismissible) { var f = document.createElement("span"); f.classList.add("js-snackbar__close"), f.innerText = "×", f.onclick = a.Close, c.appendChild(f) } i.style.height = "0px", i.style.opacity = "0", i.style.marginTop = "0px", i.style.marginBottom = "0px", i.appendChild(c), n.appendChild(i), !1 !== r.timeout && (s = setTimeout(a.Close, r.timeout)) }(), a.Open() } \ No newline at end of file