-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblock-ui.min.js
1 lines (1 loc) · 1001 Bytes
/
block-ui.min.js
1
const BlockUI=function(e){return{blocked:function(){let t=document.getElementById(e),o=t.children[t.childElementCount-1];return o.classList.contains("vzool-blockui")},show:function(){let t=document.vzool_blockui_image||"loader.gif",o=document.vzool_blockui_background||"#121111",n=document.vzool_blockui_color||"#ffffff";if(!this.blocked()){var l=document.createElement("div");return l.id="vzool-blockui-"+Date.now(),l.setAttribute("class","vzool-blockui"),l.style.cssText=`background:url(${t}) no-repeat center center;background-color:${o};color:${n};border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0;display:flex;align-items:center;justify-content:center;`,document.getElementById(e).appendChild(l),l.id}},message:function(t=""){let o=document.getElementById(e),n=o.children[o.childElementCount-1];return!!this.blocked()&&(n.innerHTML=t)},hide:function(){let t=document.getElementById(e);return!!this.blocked()&&t.removeChild(t.children[t.childElementCount-1])}}};