Skip to content

Commit

Permalink
Moved mousedown event parameter in function and fixed wrongly placed …
Browse files Browse the repository at this point in the history
…parentheses
  • Loading branch information
nicoeg authored and Leopoldthecoder committed Mar 15, 2017
1 parent 8034144 commit ae32eb1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/utils/clickoutside.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 &&
Expand Down

0 comments on commit ae32eb1

Please sign in to comment.