Bugzilla – Attachment 37043 Details for
Bug 9120
Typing the ENTER key when submitting a tag from search results reloads the page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[Signed-off] Bug 9120: Prevent form submission on adding tags - OPAC
Signed-off-Bug-9120-Prevent-form-submission-on-add.patch (text/plain), 2.74 KB, created by
Marc Véron
on 2015-03-20 13:56:27 UTC
(
hide
)
Description:
[Signed-off] Bug 9120: Prevent form submission on adding tags - OPAC
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2015-03-20 13:56:27 UTC
Size:
2.74 KB
patch
obsolete
>From 40d610815cc1c6673806fce939ea55a87512036a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 18 Mar 2015 17:21:42 +0100 >Subject: [PATCH] [Signed-off] Bug 9120: Prevent form submission on adding > tags - OPAC >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >At the OPAC, if the user adds tags pressing 'Enter', the page is >reloaded and the tags are not added. >To prevent that, this patch suggests to block the "press enter" event on >the inputs. > >Test plan: >0/ Confirm the bad behavior, without this patch. >1/ Apply this patch and confirm nothing happen on pressing enter when >the focus is on the add tag input (At the opac, on the result view). > >Patch works as expected. >Signed-off-by: Marc Véron <veron@veron.ch> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index 2d7ccf6..ec40189 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -486,7 +486,7 @@ > <span class="actions"><a class="tag_add" id="tag_add[% SEARCH_RESULT.biblionumber %]" href="#">Add tag</a></span> > <div id="tagform[% SEARCH_RESULT.biblionumber %]" class="tag_results_input" style="display:none;"> > <label for="newtag[% SEARCH_RESULT.biblionumber %]">New tag(s), separated by a comma:</label> >- <input type="text" name="newtag[% SEARCH_RESULT.biblionumber %]" id="newtag[% SEARCH_RESULT.biblionumber %]" maxlength="100" /> >+ <input type="text" name="newtag[% SEARCH_RESULT.biblionumber %]" id="newtag[% SEARCH_RESULT.biblionumber %]" class="newtag" maxlength="100" /> > <input name="tagbutton" class="btn btn-small tagbutton" title="[% SEARCH_RESULT.biblionumber %]" type="submit" value="Add" /> > <a class="cancel_tag_add" id="cancel[% SEARCH_RESULT.biblionumber %]" href="#">(done)</a> > </div> >@@ -919,6 +919,10 @@ $(document).ready(function(){ > }); > [% END %] > >+$("input.newtag").on('keydown', function(e){ >+ if (e.keyCode == 13) { e.preventDefault(); } >+}); >+ > }); > //]]> > </script> >-- >1.7.10.4
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 9120
:
36991
|
37043
|
37071
|
37399