Update v-click-outside-x and use project wide directive

This commit is contained in:
Graham Fairweather 2018-05-30 15:29:46 +02:00
parent 427b869297
commit 26369639b6
15 changed files with 15962 additions and 16013 deletions

View file

@ -1,21 +0,0 @@
export default {
bind (el, binding, vnode) {
function documentHandler (e) {
if (el.contains(e.target)) {
return false;
}
if (binding.expression) {
binding.value(e);
}
}
el.__vueClickOutside__ = documentHandler;
document.addEventListener('click', documentHandler);
},
update () {
},
unbind (el, binding) {
document.removeEventListener('click', el.__vueClickOutside__);
delete el.__vueClickOutside__;
}
};