From 4f55c9d68d870a2a960ab3660be8ae1cfdf67fce Mon Sep 17 00:00:00 2001 From: Frederic van der Essen Date: Fri, 8 Aug 2014 15:27:06 +0200 Subject: [PATCH] [FIX] point_of_sale: it was too easy to accidentally hit the close button on ipads, made it double click only --- addons/point_of_sale/static/src/css/pos.css | 5 +++++ addons/point_of_sale/static/src/js/widgets.js | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index ab0d52cc193..abb724318f7 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -399,6 +399,11 @@ td { background: rgba(0,0,0,0.2); color:#EEE; } +.pos .pos-rightheader .header-button.confirm { + background: #F03F00; + color: white; + font-weight: bold; +} /* c) The notifications indicator */ diff --git a/addons/point_of_sale/static/src/js/widgets.js b/addons/point_of_sale/static/src/js/widgets.js index 0f846b9d924..5788afc086c 100644 --- a/addons/point_of_sale/static/src/js/widgets.js +++ b/addons/point_of_sale/static/src/js/widgets.js @@ -1131,7 +1131,21 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa this.close_button = new module.HeaderButtonWidget(this,{ label: _t('Close'), - action: function(){ self.close(); }, + action: function(){ + var self = this; + if (!this.confirmed) { + this.$el.addClass('confirm'); + this.$el.text(_t('Confirm')); + this.confirmed = setTimeout(function(){ + self.$el.removeClass('confirm'); + self.$el.text(_t('Close')); + self.confirmed = false; + },900); + } else { + clearTimeout(this.confirmed); + this.pos_widget.close(); + } + }, }); this.close_button.appendTo(this.$('.pos-rightheader'));