From 23ed373e5da2bb5e9739e5e59e2d1e76627fdc89 Mon Sep 17 00:00:00 2001 From: hieplq Date: Thu, 20 Aug 2020 13:47:01 +0700 Subject: [PATCH] IDEMPIERE-4413:Change Role, disfunction all keyboard shortcuts (#216) remove keydown handle at client side --- .../WEB-INF/src/web/js/zkforge/KeyListener.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/web/js/zkforge/KeyListener.js b/org.adempiere.ui.zk/WEB-INF/src/web/js/zkforge/KeyListener.js index 2dad197d90..55130ca0a5 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/web/js/zkforge/KeyListener.js +++ b/org.adempiere.ui.zk/WEB-INF/src/web/js/zkforge/KeyListener.js @@ -45,12 +45,23 @@ zkforge.KeyListener = zk.$extends(zul.Widget, { var self = this; jq(document).ready(function () { - jq(document).keydown(function (evt) { - self.keyDown(evt); - }); + jq(document).keydown(self, self.keyDownHandle); }); }, + unbind_: function (skipper, after) { + this.$supers('unbind_', arguments); + + var self = this; + jq(document).off("keydown", self.keyDownHandle); + }, + + keyDownHandle: function(evt){ + var self = evt.data; + self.keyDown(evt); + + }, + keyDown: function(evt) { if (!evt) evt = window.event;