diff --git a/dist/vue-clickaway.common.js b/dist/vue-clickaway.common.js index 356e20f..765acb4 100644 --- a/dist/vue-clickaway.common.js +++ b/dist/vue-clickaway.common.js @@ -46,7 +46,7 @@ function bind(el, binding, vnode) { }, 0); el[HANDLER] = function(ev) { - // @NOTE: this test used to be just `el.containts`, but working with path is better, + // @NOTE: this test used to be just `el.contains`, but working with path is better, // because it tests whether the element was there at the time of // the click, not whether it is there now, that the event has arrived // to the top. @@ -67,9 +67,9 @@ function unbind(el) { var directive = { bind: bind, - update: function(el, binding) { + update: function(el, binding, vnode) { if (binding.value === binding.oldValue) return; - bind(el, binding); + bind(el, binding, vnode); }, unbind: unbind, }; diff --git a/dist/vue-clickaway.js b/dist/vue-clickaway.js index f2a90a4..ea946b4 100644 --- a/dist/vue-clickaway.js +++ b/dist/vue-clickaway.js @@ -66,9 +66,9 @@ var directive = { bind: bind, - update: function(el, binding) { + update: function(el, binding, vnode) { if (binding.value === binding.oldValue) return; - bind(el, binding); + bind(el, binding, vnode); }, unbind: unbind, }; diff --git a/dist/vue-clickaway.min.js b/dist/vue-clickaway.min.js index dace22a..3e01f39 100644 --- a/dist/vue-clickaway.min.js +++ b/dist/vue-clickaway.min.js @@ -1 +1 @@ -!function(e,t){"use strict";function n(e,t,n){i(e);var u=n.context,a=t.value;if("function"==typeof a){var c=!1;setTimeout(function(){c=!0},0),e[o]=function(t){var n=t.path||(t.composedPath?t.composedPath():void 0);if(c&&(n?n.indexOf(e)<0:!e.contains(t.target)))return a.call(u,t)},document.documentElement.addEventListener("click",e[o],!1)}}function i(e){document.documentElement.removeEventListener("click",e[o],!1),delete e[o]}t="default"in t?t.default:t;/^2\./.test(t.version)||t.util.warn("VueClickaway 2.2.2 only supports Vue 2.x, and does not support Vue "+t.version);var o="_vue_clickaway_handler",u={bind:n,update:function(e,t){t.value!==t.oldValue&&n(e,t)},unbind:i},a={directives:{onClickaway:u}};e.version="2.2.2",e.directive=u,e.mixin=a}(this.VueClickaway={},Vue); \ No newline at end of file +!function(e,t){"use strict";function n(e,t,n){i(e);var u=n.context,a=t.value;if("function"==typeof a){var c=!1;setTimeout(function(){c=!0},0),e[o]=function(t){var n=t.path||(t.composedPath?t.composedPath():void 0);if(c&&(n?n.indexOf(e)<0:!e.contains(t.target)))return a.call(u,t)},document.documentElement.addEventListener("click",e[o],!1)}}function i(e){document.documentElement.removeEventListener("click",e[o],!1),delete e[o]}t="default"in t?t.default:t;/^2\./.test(t.version)||t.util.warn("VueClickaway 2.2.2 only supports Vue 2.x, and does not support Vue "+t.version);var o="_vue_clickaway_handler",u={bind:n,update:function(e,t,i){t.value!==t.oldValue&&n(e,t,i)},unbind:i},a={directives:{onClickaway:u}};e.version="2.2.2",e.directive=u,e.mixin=a}(this.VueClickaway={},Vue); \ No newline at end of file diff --git a/index.js b/index.js index bc362a3..5dac52e 100644 --- a/index.js +++ b/index.js @@ -43,7 +43,7 @@ function bind(el, binding, vnode) { }, 0); el[HANDLER] = function(ev) { - // @NOTE: this test used to be just `el.containts`, but working with path is better, + // @NOTE: this test used to be just `el.contains`, but working with path is better, // because it tests whether the element was there at the time of // the click, not whether it is there now, that the event has arrived // to the top. @@ -64,9 +64,9 @@ function unbind(el) { export var directive = { bind: bind, - update: function(el, binding) { + update: function(el, binding, vnode) { if (binding.value === binding.oldValue) return; - bind(el, binding); + bind(el, binding, vnode); }, unbind: unbind, };