소스 검색

[FIX] sidebar folding function

Gogs 7 년 전
부모
커밋
d5eb105a72
2개의 변경된 파일11개의 추가작업 그리고 4개의 파일을 삭제
  1. 0 2
      src/components/cart/CartItem.vue
  2. 11 2
      src/index.js

+ 0 - 2
src/components/cart/CartItem.vue

@@ -34,8 +34,6 @@
                     return this.item.qty || 1
                 },
                 set(value) {
-                    console.log(value)
-
                     this.item.qty = value || 1
                 }
             },

+ 11 - 2
src/index.js

@@ -12,7 +12,8 @@ openerp.eiru_pos = (instance, local) => {
 
     local.PosWidget = instance.Widget.extend({
         start() {
-            instance.eiru_theme.instance.hide()
+            this.sidebarFold()
+            
             this.vm = new Vue({
                 store,
                 el: this.el,
@@ -29,9 +30,17 @@ openerp.eiru_pos = (instance, local) => {
             this.vm.$destroy()
             $(this.vm.$el).remove()
             this.vm = null
-            instance.eiru_theme.instance.show()
+
+            this.sidebarUnfold()
 
             this._super.apply(this, arguments)
+        },
+        sidebarFold() {
+            if (!instance.eiru_sidebar_toggler) return
+            instance.eiru_sidebar_toggler.sidebar_fold()
+        },
+        sidebarUnfold() {
+            instance.eiru_sidebar_toggler.sidebar_unfold()
         }
     })