From 74c0d6679385687330174de0f34c5a5f1359de63 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 15 Oct 2014 12:36:27 -0400 Subject: [PATCH] [PASSED QA] Bug 13089 - Tab key triggers JavaScript error in the checkEnter function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tabbing through fields in the patron add form or MARC editor triggers a JavaScript error for each tab. The cause seems to be some JS which was designed to accommodate differences between Mozilla browsers and Internet Explorer. A slight modification seems to work just as well in Firefox and IE. To test, apply the patch and clear your browser cache if necessary. To look for JavaScript errors, open the Developer Tools console in Firefox, Chrome, or Internet Explorer (or in Firefox's Firebug console). Create a new patron and use the tab key to move between inputs. No error should be reported in the console. Test typing in fields and pressing enter. The form should not be submitted. Test in all available browsers, including at least IE11, IE10, and IE9. Reproduced with FF 32 Tested with FF 32, Chrome 38, IE 11 and IE Emulations 8,9,10 No JavaScript errors found. Enter does not submit. Signed-off-by: Marc VĂ©ron Signed-off-by: Katrin Fischer Tested in Chromium, confirmed the problem and that the patch fixes it. Passes tests and QA script. --- koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js index fa75b44..5b086f1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js @@ -55,10 +55,8 @@ $.fn.selectTabByID = function (tabID) { function checkEnter(e){ //e is event object passed from function invocation var characterCode; // literal character code will be stored in this variable if(e && e.which){ //if which property of event object is supported (NN4) - e = e; characterCode = e.which; //character code is contained in NN4's which property } else { - e = window.event; characterCode = e.keyCode; //character code is contained in IE's keyCode property } -- 1.9.1