2019-09-09 17:00:25 +01:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
|
|
|
// See LICENSE for copying information.\
|
|
|
|
|
2019-11-06 12:41:59 +00:00
|
|
|
import Vue, { VNode } from 'vue';
|
|
|
|
import { DirectiveBinding } from 'vue/types/options';
|
2019-09-09 17:00:25 +01:00
|
|
|
|
|
|
|
import App from './app/App.vue';
|
2020-01-31 16:55:37 +00:00
|
|
|
import { router } from './app/router';
|
|
|
|
import { store } from './app/store';
|
2019-09-09 17:00:25 +01:00
|
|
|
|
|
|
|
Vue.config.productionTip = false;
|
|
|
|
|
2019-11-06 12:41:59 +00:00
|
|
|
let clickOutsideEvent: EventListener;
|
|
|
|
|
|
|
|
Vue.directive('click-outside', {
|
|
|
|
bind: function (el: HTMLElement, binding: DirectiveBinding, vnode: VNode) {
|
|
|
|
clickOutsideEvent = function(event: Event): void {
|
|
|
|
if (el === event.target) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (vnode.context) {
|
|
|
|
vnode.context[binding.expression](event);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
document.body.addEventListener('click', clickOutsideEvent);
|
|
|
|
},
|
|
|
|
unbind: function(): void {
|
|
|
|
document.body.removeEventListener('click', clickOutsideEvent);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2019-09-09 17:00:25 +01:00
|
|
|
new Vue({
|
|
|
|
router,
|
|
|
|
render: (h) => h(App),
|
|
|
|
store,
|
|
|
|
}).$mount('#app');
|