mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-12-04 05:09:43 +08:00
Moved mousedown event parameter in function and fixed wrongly placed parentheses
This commit is contained in:
parent
8034144001
commit
ae32eb13aa
@ -9,7 +9,7 @@ let startClick;
|
||||
!Vue.prototype.$isServer && on(document, 'mousedown', e => (startClick = e));
|
||||
|
||||
!Vue.prototype.$isServer && on(document, 'mouseup', e => {
|
||||
nodeList.forEach(node => node[ctx].documentHandler(e));
|
||||
nodeList.forEach(node => node[ctx].documentHandler(e, startClick));
|
||||
});
|
||||
/**
|
||||
* v-clickoutside
|
||||
@ -22,13 +22,12 @@ let startClick;
|
||||
export default {
|
||||
bind(el, binding, vnode) {
|
||||
const id = nodeList.push(el) - 1;
|
||||
const documentHandler = function(e) {
|
||||
const documentHandler = function(mouseup, mousedown) {
|
||||
if (!vnode.context ||
|
||||
el.contains(e.target) ||
|
||||
el.contains(startClick.target) ||
|
||||
el.contains(mouseup.target) ||
|
||||
(vnode.context.popperElm &&
|
||||
(vnode.context.popperElm.contains(e.target)) ||
|
||||
vnode.context.popperElm.contains(startClick.target))) return;
|
||||
(vnode.context.popperElm.contains(mouseup.target) ||
|
||||
vnode.context.popperElm.contains(mousedown.target)))) return;
|
||||
|
||||
if (binding.expression &&
|
||||
el[ctx].methodName &&
|
||||
|
Loading…
Reference in New Issue
Block a user