1
0
mirror of https://gitlab.com/bramw/baserow.git synced 2024-11-21 23:37:55 +00:00
bramw_baserow/web-frontend/modules/core/directives/clickOutside.js

13 lines
315 B
JavaScript

import { onClickOutside } from '@baserow/modules/core/utils/dom'
export default {
bind(el, binding, vnode) {
el.onClickOutsideEventCancelDirective = onClickOutside(el, (target) => {
vnode.context[binding.expression](target)
})
},
unbind(el) {
el.onClickOutsideEventCancelDirective()
},
}