Commit ae32eb13 authored by Nicolaj Egelund's avatar Nicolaj Egelund Committed by 杨奕

Moved mousedown event parameter in function and fixed wrongly placed parentheses

parent 80341440
......@@ -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 &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment