Skip to content

Commit

Permalink
[FIX] point_of_sale: prevent backspace from performing a 'back' navig…
Browse files Browse the repository at this point in the history
…ation.
  • Loading branch information
fvdsn committed May 4, 2015
1 parent d3c18f5 commit e0b9172
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions addons/point_of_sale/static/src/js/chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ var Chrome = PosBaseWidget.extend({
self.build_chrome();
self.build_widgets();
self.disable_rubberbanding();
self.disable_backpace_back();
self.ready.resolve();
self.loading_hide();
self.replace_crashmanager();
Expand Down Expand Up @@ -550,6 +551,15 @@ var Chrome = PosBaseWidget.extend({
});
},

// prevent backspace from performing a 'back' navigation
disable_backpace_back: function() {
$(document).on("keydown", function (e) {
if (e.which === 8 && !$(e.target).is("input, textarea")) {
e.preventDefault();
}
});
},

loading_error: function(err){
var self = this;

Expand Down

0 comments on commit e0b9172

Please sign in to comment.