static.smart-ui.ui-groups.antd.dialog-drag.js Maven / Gradle / Ivy
(function(){
function isOwnOrChildren(target,sources){
var flag = false;
for(var i=0;i window.innerWidth-dialog.clientWidth){
left = window.innerWidth-dialog.clientWidth;
}
var top = (e.clientY-tool.attr[attr].startY+tool.attr[attr].eleY);
if(top<0){
top = 0;
}
if(top > window.innerHeight-dialog.clientHeight){
top = window.innerHeight-dialog.clientHeight;
}
dialog.style["left"]=left+"px";
dialog.style["top"]=top+"px";
}
});
})(attr,selector,nums);
},
init:function(){
var bodys = document.getElementsByTagName("body");
if(bodys && bodys.length>0){
tool.bindDrag("elDialog",".ant-modal .ant-modal-header",2);
tool.bindDrag("elMessageBox",".ant-modal .ant-modal-content",1);
}else{
setTimeout(function(){
tool.init();
},300);
}
}
}
tool.init();
window.dialogToCenter=function(){
setTimeout(function () {
var dialog = document.querySelector(".ant-modal");
if(!dialog){
return;
}
var left = (window.innerWidth-dialog.clientWidth)/2;
var top = (window.innerHeight-dialog.clientHeight)/3;
dialog.style["left"]=left+"px";
dialog.style["top"]=top+"px";
},10);
}
})();
© 2015 - 2025 Weber Informatics LLC | Privacy Policy