Skip to content

Commit e036bcc

Browse files
author
Den
committed
remove on-click-outside
1 parent 567f408 commit e036bcc

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/popup/popup.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,7 @@ import App from './App.vue'
33

44
global.browser = require('webextension-polyfill')
55
Vue.prototype.$browser = global.browser
6-
Vue.directive('click-outside', {
7-
bind: function (el, binding, vnode) {
8-
el.clickOutsideEvent = function (event) {
9-
// here I check that click was outside the el and his children
10-
if (!(el === event.target || el.contains(event.target))) {
11-
// and if it did, call method provided in attribute value
12-
vnode.context[binding.expression](event)
13-
}
14-
}
15-
document.body.addEventListener('click', el.clickOutsideEvent)
16-
},
17-
unbind: function (el) {
18-
document.body.removeEventListener('click', el.clickOutsideEvent)
19-
}
20-
})
6+
217
/* eslint-disable no-new */
228
new Vue({
239
el: '#app',

0 commit comments

Comments
 (0)