From 68f8dd7e2333781b0becf9f319aaade38e6d1464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Tue, 17 Dec 2013 16:15:50 +0100 Subject: [PATCH] [FIX] point_of_sale: activate the font 'Lato' & prevent rubberbanding on application body when possible bzr revid: fva@openerp.com-20131217151550-i8wd88qby6gjaclj --- addons/point_of_sale/controllers/main.py | 2 +- addons/point_of_sale/static/src/css/pos.css | 2 ++ addons/point_of_sale/static/src/js/widgets.js | 23 +++++++++++++++---- addons/point_of_sale/static/src/xml/pos.xml | 12 +++++----- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/addons/point_of_sale/controllers/main.py b/addons/point_of_sale/controllers/main.py index 3d08b4c821c..e6b82b7c74a 100644 --- a/addons/point_of_sale/controllers/main.py +++ b/addons/point_of_sale/controllers/main.py @@ -32,7 +32,7 @@ html_template = """ - + %(js)s diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index af0f0d8e50b..76a14ae1f7d 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -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; diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index 4c254afafc7..72a2a45f3f8 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -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 () { diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 51717f4302d..fd624b6c96d 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -115,7 +115,7 @@ -
+
@@ -197,7 +197,7 @@
-
+
@@ -253,7 +253,7 @@ -
+
@@ -282,7 +282,7 @@ -
+
@@ -305,7 +305,7 @@ -
+

Please scan an item

@@ -444,7 +444,7 @@
-
+