[FIX] point_of_sale: it was too easy to accidentally hit the close button on ipads, made it double click only

This commit is contained in:
Frederic van der Essen 2014-08-08 15:27:06 +02:00
parent 8d32f80fe3
commit 4f55c9d68d
2 changed files with 20 additions and 1 deletions

View File

@ -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 */

View File

@ -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'));