[WIP] point_of_sale: removed js scrollbars
authorFrédéric van der Essen <fva@openerp.com>
Tue, 8 Oct 2013 14:36:39 +0000 (16:36 +0200)
committerFrédéric van der Essen <fva@openerp.com>
Tue, 8 Oct 2013 14:36:39 +0000 (16:36 +0200)
bzr revid: fva@openerp.com-20131008143639-qacekusrhy6uoues

addons/point_of_sale/static/src/css/pos.css
addons/point_of_sale/static/src/js/widgets.js

index e93c977..38f61a2 100644 (file)
     width:100%;
     height:100%;
     overflow: hidden;
+    overflow-y: auto;
 }
 .point-of-sale .product-list-container {
     position:absolute;
     width:100%;
     height:100%;
     overflow:hidden;
+    overflow-y: auto;
 }
 
 .point-of-sale .order{
index 291c8bf..0bf94d4 100644 (file)
@@ -214,9 +214,6 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
 
             // freeing subwidgets
             
-            if(this.scrollbar){
-                this.scrollbar.destroy();
-            }
             for(var i = 0, len = this.orderlinewidgets.length; i < len; i++){
                 this.orderlinewidgets[i].destroy();
             }
@@ -243,30 +240,6 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
             }, this));
             this.update_numpad();
             this.update_summary();
-
-            var position = this.scrollbar ? this.scrollbar.get_position() : 0;
-            var at_bottom = this.scrollbar ? this.scrollbar.is_at_bottom() : false;
-            
-            this.scrollbar = new module.ScrollbarWidget(this,{
-                target_widget:   this,
-                target_selector: '.order-scroller',
-                name: 'order',
-                track_bottom: true,
-                on_show: function(){
-                    self.$('.order-scroller').css({'width':'89%'},100);
-                },
-                on_hide: function(){
-                    self.$('.order-scroller').css({'width':'100%'},100);
-                },
-            });
-
-            this.scrollbar.replace(this.$('.placeholder-ScrollbarWidget'));
-            this.scrollbar.set_position(position);
-
-            if( at_bottom ){
-                this.scrollbar.set_position(Number.MAX_VALUE, false);
-            }
-
         },
         update_summary: function(){
             var order = this.pos.get('selectedOrder');
@@ -609,9 +582,6 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
             var self = this;
             this._super();
             
-            if(this.scrollbar){
-                this.scrollbar.destroy();
-            }
             var products = this.pos.get('products').models || [];
             
             _.each(products,function(product,i){
@@ -621,19 +591,6 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
                 $product.appendTo(self.$('.product-list'));
             });
 
-            this.scrollbar = new module.ScrollbarWidget(this,{
-                target_widget:   this,
-                target_selector: '.product-list-scroller',
-                on_show: function(){
-                    self.$('.product-list-scroller').css({'padding-right':'62px'},100);
-                },
-                on_hide: function(){
-                    self.$('.product-list-scroller').css({'padding-right':'0px'},100);
-                },
-            });
-
-            this.scrollbar.replace(this.$('.placeholder-ScrollbarWidget'));
-
         },
     });