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;