[FIX] point_of_sale: activate the font 'Lato' & prevent rubberbanding on application...
authorFrédéric van der Essen <fva@openerp.com>
Tue, 17 Dec 2013 15:15:50 +0000 (16:15 +0100)
committerFrédéric van der Essen <fva@openerp.com>
Tue, 17 Dec 2013 15:15:50 +0000 (16:15 +0100)
bzr revid: fva@openerp.com-20131217151550-i8wd88qby6gjaclj

addons/point_of_sale/controllers/main.py
addons/point_of_sale/static/src/css/pos.css
addons/point_of_sale/static/src/js/widgets.js
addons/point_of_sale/static/src/xml/pos.xml

index 3d08b4c..e6b82b7 100644 (file)
@@ -32,7 +32,7 @@ html_template = """<!DOCTYPE html>
         <link rel="apple-touch-icon" sizes="152x152" href="/point_of_sale/static/src/img/touch-icon-ipad-retina.png">
 
         <link rel="shortcut icon" href="/web/static/src/img/favicon.ico" type="image/x-icon"/>
-        <!-- <link rel="stylesheet" href="/point_of_sale/static/src/fonts/lato/stylesheet.css" /> -->
+        <link rel="stylesheet" href="/point_of_sale/static/src/fonts/lato/stylesheet.css" /> 
         <link rel="stylesheet" href="/point_of_sale/static/src/css/pos.css" />
         <link rel="stylesheet" href="/point_of_sale/static/src/css/keyboard.css" />
         %(js)s
index af0f0d8..76a14ae 100644 (file)
@@ -9,6 +9,7 @@
 
 html {
     -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+    font-family: sans-serif;
 }
 table {
     border-spacing: 0px;
@@ -41,6 +42,7 @@ td {
     box-shadow: none;
     outline: none;
     border: none;
+    font-family: 'Lato';
 }
 .pos button:hover{
     background: default;
index 4c254af..72a2a45 100644 (file)
@@ -878,6 +878,22 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
             FastClick.attach(document.body);
 
         },
+
+        disable_rubberbanding: function(){
+            // prevent the pos body from being scrollable. 
+            document.body.addEventListener('touchmove',function(event){
+                console.log('touchmove_prevent',event);
+                var node = event.target;
+                while(node){
+                    if(node.classList && node.classList.contains('touch-scrollable')){
+                        console.log('not prevented');
+                        return;
+                    }
+                    node = node.parentNode;
+                }
+                event.preventDefault();
+            });
+        },
       
         start: function() {
             var self = this;
@@ -894,11 +910,6 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
                 $('.oe_web_client').off();
                 $('.openerp_webclient_container').off();
 
-                /*this.el.addEventHandler('click',function(event){
-                    event.stopPropagation();
-                    event.preventDefault();
-                });*/
-
                 self.build_currency_template();
                 self.renderElement();
                 
@@ -1085,6 +1096,8 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
                 this.debug_widget = new module.DebugWidget(this);
                 this.debug_widget.appendTo(this.$('.pos-content'));
             }
+
+            this.disable_rubberbanding();
         },
 
         changed_pending_operations: function () {
index 51717f4..fd624b6 100644 (file)
     </t>
 
     <t t-name="PaypadWidget">
-        <div class="paypad">
+        <div class="paypad touch-scrollable">
         </div>
     </t>
 
 
     <t t-name="ProductListWidget">
         <div class='product-list-container'>
-            <div class="product-list-scroller">
+            <div class="product-list-scroller touch-scrollable">
                 <div class="product-list">
                 </div>
             </div>
     </t>
 
     <t t-name="PaymentScreenWidget">
-        <div class="payment-screen screen">
+        <div class="payment-screen screen touch-scrollable">
             <div class="pos-payment-container">
                 <div class='payment-due-total'></div>
                 <div class='payment-lines'></div>
     </t>
 
     <t t-name="ReceiptScreenWidget">
-        <div class="receipt-screen screen" >
+        <div class="receipt-screen screen touch-scrollable" >
             <div class="pos-step-container">
                 <div class="pos-receipt-container">
                 </div>
 
 
     <t t-name="ScanProductScreenWidget">
-        <div class="scan-product-screen screen">
+        <div class="scan-product-screen screen touch-scrollable">
             <header class='rightpane-header'><h2>Please scan an item</h2></header>
             <img src="/point_of_sale/static/src/img/scan.png" />
         </div>
 
     <t t-name="OrderWidget">
         <div class="order-container">
-            <div class="order-scroller">
+            <div class="order-scroller touch-scrollable">
                 <div class="order">
                     <ul class="orderlines">
                         <t t-if="orderlines.length === 0">