details: https://code.openbravo.com/erp/devel/pi/rev/8a7218c16d56
changeset: 18177:8a7218c16d56
user: David Baz Fayos <david.baz <at> openbravo.com>
date: Wed Oct 10 01:02:35 2012 +0200
summary: Related to issue 21776: Prevent 'Backspace' key propagation in DIVs
to avoid 'Go to previous page' default browser behavior
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
| 2 +-
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-keyboard-manager.js
| 11 ++++++++++
2 files changed, 12 insertions(+), 1 deletions(-)
diffs (33 lines):
diff -r 4c91b7f6a04f -r 8a7218c16d56
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
Tue Oct 09 15:34:19 2012 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
Wed Oct 10 01:02:35 2012 +0200
@@ -248,7 +248,7 @@
if (LKS.list[i].execLevel) {
for (j = 0; j < LKS.list[i].execLevel.length; j++) {
- if (LKS.list[i].execLevel[j] === 'Canvas') {
+ if (LKS.list[i].execLevel[j] === 'Canvas' && LKS.list[i].id !==
'Canvas_Avoid_Backspace') {
isCanvasShortcut = true;
break;
}
diff -r 4c91b7f6a04f -r 8a7218c16d56
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-keyboard-manager.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-keyboard-manager.js
Tue Oct 09 15:34:19 2012 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-keyboard-manager.js
Wed Oct 10 01:02:35 2012 +0200
@@ -347,6 +347,17 @@
// Initialize KeyboardManager object
keyboardMgr = O.KeyboardManager = new KeyboardManager();
+ // To avoid default browser behavior that makes "Backspace" key go to
previous html page
+ O.KeyboardManager.Shortcuts.set('Canvas_Avoid_Backspace', 'Canvas', function
() {
+ if (document.activeElement &&
(document.activeElement.tagName.toLowerCase() === 'div' ||
document.activeElement.tagName.toLowerCase() === 'body')) {
+ return false;
+ } else {
+ return true;
+ }
+ }, null, {
+ "key": "Backspace"
+ });
+
// To fix issue https://issues.openbravo.com/view.php?id=21786
isc.ComboBoxItem.getPrototype()._originalKeyDown =
isc.ComboBoxItem.getPrototype().keyDown;
isc.ComboBoxItem.getPrototype().keyDown = function () {
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits