123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- import Vue from 'vue'
- import App from '@/App'
- import VueModal from 'vue-js-modal'
- import store from '@/store'
- import currency from '@@/filters/currency'
- import absolute from '@@/filters/absolute'
- Vue.filter('currency', currency)
- Vue.filter('absolute', absolute)
- Vue.use(VueModal)
- Vue.config.productionTip = false
- Vue.config.silent = true
- Vue.config.devTools = true
- openerp.eiru_pos = (instance, local) => {
- local.PosWidget = instance.Widget.extend({
- init(parent, action) {
- this._super(parent)
- this.mode = action.params.mode
- },
- start() {
- this.sidebarFold()
- this.vm = new Vue({
- store,
- el: this.el,
- template: '<App />',
- components: {
- App
- },
- data: {
- mode: this.mode
- },
- created() {
- // if ('serviceWorker' in navigator) {
- // navigator.serviceWorker.register('./sw.js').then(ok => {
- // console.log(ok)
- // }).then(e => {
- // console.log(e)
- // })
- // }
- }
- });
- },
- destroy() {
- this.vm.$destroy()
- $(this.vm.$el).remove()
- this.vm = null
- this.sidebarUnfold()
- this._super.apply(this, arguments)
- },
- sidebarFold() {
- if (!instance.eiru_sidebar_toggler) return
- instance.eiru_sidebar_toggler.sidebar_fold()
- },
- sidebarUnfold() {
- if (!instance.eiru_sidebar_toggler) return
- instance.eiru_sidebar_toggler.sidebar_unfold()
- }
- })
- instance.web.client_actions.add('eiru_pos.action_launch', 'instance.eiru_pos.PosWidget')
- }
|