Bugzilla – Attachment 26560 Details for
Bug 11563
Class noEnterSubmit no longer functioning
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11563 - Class noEnterSubmit no longer functioning
Bug-11563---Class-noEnterSubmit-no-longer-function.patch (text/plain), 2.60 KB, created by
Biblibre Sandboxes
on 2014-03-25 15:32:58 UTC
(
hide
)
Description:
Bug 11563 - Class noEnterSubmit no longer functioning
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2014-03-25 15:32:58 UTC
Size:
2.60 KB
patch
obsolete
>From 01119277eb89bf827f743ca44fbb680ad21eec52 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 25 Feb 2014 12:13:13 +0100 >Subject: [PATCH] Bug 11563 - Class noEnterSubmit no longer functioning > >For some reason, even if an input as the class noEnterSubmit, the code found in staff-global.js for preventing submission when hitting the enter key is no longer triggered. >This is because this class is added using JavaScript in $(document).ready() and the keypress event listerning is also set using $(document).ready(). > >This patch corrects by using JQuery live() with will set event listerning event for HTML generated with JavaScript. >Alos sets noEnterSubmit to use the checkEnter(e) function, containing a more correct code. >Also corrects a small bug, for IE, window.event must be used, not event alone (even if IE is not supported for intranet). > >Test plan : >- Flush browser cache (Crtl+F5) to update js files >- Go to patron creation : members/memberentrygen.tt >- Type a text in all mandatory inputs >- Type some caracters in a non mandatory input >- Press Enter key >=> Without patch : the form is submitted >=> With patch : the form is not submitted >- Try to set several lines in a textarea >=> It works (checks that in this case enter key is allowed) >- Test other pages usign noEnterSubmit class : >cataloguing/additem.tt >course_reserves/course.tt >members/mancredit.tt >members/maninvoice.tt >patron_lists/list.tt > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> > >Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> >--- > koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js | 6 +++--- > 1 files changed, 3 insertions(+), 3 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 c97007f..2bc8424 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js >@@ -25,8 +25,8 @@ function _(s) { return s; } // dummy function for gettext > return false; > }); > >- $('.noEnterSubmit').keypress(function(e){ >- if ( e.which == 13 ) return false; >+ $('.noEnterSubmit').live("keypress", function(e){ >+ return checkEnter(e); > }); > }); > >@@ -37,7 +37,7 @@ function checkEnter(e){ //e is event object passed from function invocation > e = e; > characterCode = e.which; //character code is contained in NN4's which property > } else { >- e = event; >+ e = window.event; > characterCode = e.keyCode; //character code is contained in IE's keyCode property > } > >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11563
:
25615
|
25676
|
25678
|
25935
|
26443
|
26444
|
26445
|
26545
|
26560
|
26561
|
26562
|
26563
|
26566
|
26567
|
26568
|
26569
|
26570
|
26571
|
26572
|
26573