锁定弹窗问题
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
455f808f49
commit
5af7e8dd3c
|
@ -10,7 +10,7 @@ const dialogDrag = Vue.directive('dialogDrag', {
|
|||
dragDom.style.cssText += ';top:0px;'
|
||||
|
||||
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
|
||||
const sty = (function() {
|
||||
const sty = (function () {
|
||||
if (window.document.currentStyle) {
|
||||
return (dom, attr) => dom.currentStyle[attr]
|
||||
} else {
|
||||
|
@ -47,8 +47,10 @@ const dialogDrag = Vue.directive('dialogDrag', {
|
|||
styL = +styL.replace(/\px/g, '')
|
||||
styT = +styT.replace(/\px/g, '')
|
||||
}
|
||||
const oldMousemove = document.onmousemove
|
||||
|
||||
document.onmousemove = function(e) {
|
||||
document.onmousemove = function (e) {
|
||||
oldMousemove(e)
|
||||
// 通过事件委托,计算移动的距离
|
||||
let left = e.clientX - disX
|
||||
const top = e.clientY - disY
|
||||
|
@ -70,8 +72,8 @@ const dialogDrag = Vue.directive('dialogDrag', {
|
|||
dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`
|
||||
}
|
||||
|
||||
document.onmouseup = function(e) {
|
||||
document.onmousemove = null
|
||||
document.onmouseup = function (e) {
|
||||
document.onmousemove = oldMousemove
|
||||
document.onmouseup = null
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,8 +40,9 @@ Vue.directive('dialogDrag', {
|
|||
styL = +styL.replace(/\px/g, '')
|
||||
styT = +styT.replace(/\px/g, '')
|
||||
}
|
||||
|
||||
const oldMousemove = document.onmousemove
|
||||
document.onmousemove = function(e) {
|
||||
oldMousemove(e)
|
||||
// 通过事件委托,计算移动的距离
|
||||
let left = e.clientX - disX
|
||||
let top = e.clientY - disY
|
||||
|
@ -63,7 +64,7 @@ Vue.directive('dialogDrag', {
|
|||
}
|
||||
|
||||
document.onmouseup = function(e) {
|
||||
document.onmousemove = null
|
||||
document.onmousemove = oldMousemove
|
||||
document.onmouseup = null
|
||||
}
|
||||
return false
|
||||
|
|
Loading…
Reference in New Issue