mirror of https://github.com/ElemeFE/element
Moved mousedown event parameter in function and fixed wrongly placed parentheses
parent
8034144001
commit
ae32eb13aa
|
@ -9,7 +9,7 @@ let startClick;
|
||||||
!Vue.prototype.$isServer && on(document, 'mousedown', e => (startClick = e));
|
!Vue.prototype.$isServer && on(document, 'mousedown', e => (startClick = e));
|
||||||
|
|
||||||
!Vue.prototype.$isServer && on(document, 'mouseup', 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
|
* v-clickoutside
|
||||||
|
@ -22,13 +22,12 @@ let startClick;
|
||||||
export default {
|
export default {
|
||||||
bind(el, binding, vnode) {
|
bind(el, binding, vnode) {
|
||||||
const id = nodeList.push(el) - 1;
|
const id = nodeList.push(el) - 1;
|
||||||
const documentHandler = function(e) {
|
const documentHandler = function(mouseup, mousedown) {
|
||||||
if (!vnode.context ||
|
if (!vnode.context ||
|
||||||
el.contains(e.target) ||
|
el.contains(mouseup.target) ||
|
||||||
el.contains(startClick.target) ||
|
|
||||||
(vnode.context.popperElm &&
|
(vnode.context.popperElm &&
|
||||||
(vnode.context.popperElm.contains(e.target)) ||
|
(vnode.context.popperElm.contains(mouseup.target) ||
|
||||||
vnode.context.popperElm.contains(startClick.target))) return;
|
vnode.context.popperElm.contains(mousedown.target)))) return;
|
||||||
|
|
||||||
if (binding.expression &&
|
if (binding.expression &&
|
||||||
el[ctx].methodName &&
|
el[ctx].methodName &&
|
||||||
|
|
Loading…
Reference in New Issue