Bugzilla – Attachment 86412 Details for
Bug 15911
Use noEnterSubmit CSS class instead of prevent_submit.js
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15911: Use noEnterSubmit CSS class instead of prevent_submit.js
Bug-15911-Use-noEnterSubmit-CSS-class-instead-of-p.patch (text/plain), 4.90 KB, created by
Katrin Fischer
on 2019-03-09 20:33:04 UTC
(
hide
)
Description:
Bug 15911: Use noEnterSubmit CSS class instead of prevent_submit.js
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-03-09 20:33:04 UTC
Size:
4.90 KB
patch
obsolete
>From 5e06c621678ff50e936758afffda6f0488caf44b Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 22 Feb 2019 14:27:07 +0000 >Subject: [PATCH] Bug 15911: Use noEnterSubmit CSS class instead of > prevent_submit.js > >This patch removes the use of a separate js file, prevent_submit.js, in >favor of using a CSS class to trigger the same functionality in >staff-global.js. > >To test, apply the patch and test the following pages to confirm that >pressing "Enter" when the cursor is in any field in the main form does >not submit the form. > > - In Acquisitions, add to a basket from a new (empty) record > - In Acquisitions, receive an order line > - In Serials, locate a subscription and open the "Edit serials" page > from the "Serial collection" page. > >Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../intranet-tmpl/prog/en/modules/acqui/neworderempty.tt | 3 +-- > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt | 3 +-- > .../intranet-tmpl/prog/en/modules/serials/serials-edit.tt | 3 +-- > koha-tmpl/intranet-tmpl/prog/js/prevent_submit.js | 11 ----------- > 4 files changed, 3 insertions(+), 17 deletions(-) > delete mode 100644 koha-tmpl/intranet-tmpl/prog/js/prevent_submit.js > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >index b3b8b41f9e..ff0113f563 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >@@ -71,7 +71,7 @@ > </div> > [% END %] > >-<form action="/cgi-bin/koha/acqui/addorder.pl" method="post" class="validated" id="Aform" onsubmit="return Check(this);" > >+<form action="/cgi-bin/koha/acqui/addorder.pl" method="post" class="validated noEnterSubmit" id="Aform" onsubmit="return Check(this);" > > > <fieldset class="rows"> > <legend>Patrons</legend> >@@ -532,7 +532,6 @@ > [% INCLUDE 'additem.js.inc' %] > [% Asset.js("js/additem.js") | $raw %] > [% Asset.js("js/cataloging.js") | $raw %] >- [% Asset.js("js/prevent_submit.js") | $raw %] > <script> > actTotal = ""; > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >index ef27531a58..d88f0e5a03 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >@@ -23,7 +23,7 @@ > <h1>Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]] [% END %] (order #[% ordernumber | html %])</h1> > > [% IF ( count ) %] >- <form action="/cgi-bin/koha/acqui/finishreceive.pl" method="post" onsubmit="return Check(this);"> >+ <form action="/cgi-bin/koha/acqui/finishreceive.pl" class="noEnterSubmit" method="post" onsubmit="return Check(this);"> > <div class="row"> > <div class="col-sm-6"> > <div class="dialog alert order_error" style="display:none"></div> >@@ -329,7 +329,6 @@ > [% INCLUDE 'additem.js.inc' %] > [% Asset.js("js/additem.js") | $raw %] > [% Asset.js("js/cataloging.js") | $raw %] >- [% Asset.js("js/prevent_submit.js") | $raw %] > <script> > function Check(form) { > [% IF (AcqCreateItemReceiving) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >index d36a48127d..0423a4168c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >@@ -5,7 +5,6 @@ > <title>Koha › Serials › Serial edition [% bibliotitle | html %]</title> > [% INCLUDE 'doc-head-close.inc' %] > [% Asset.js("js/cataloging.js") | $raw %] >-[% Asset.js("js/prevent_submit.js") | $raw %] > [% INCLUDE 'calendar.inc' %] > <script> > //<![CDATA[ >@@ -97,7 +96,7 @@ $(document).ready(function() { > [% IF location %] ([% AuthorisedValues.GetByCode('LOC', location) | html %])[% END %] > [% IF ( callnumber ) %] callnumber: [% callnumber | html %][% END %]</h1> > [% IF internalnotes %]<p>Nonpublic note: [% internalnotes | html %]</p>[% END %] >-<form method="post" name="f" action="serials-edit.pl" id="serials_edit"> >+<form method="post" name="f" class="noEnterSubmit" action="serials-edit.pl" id="serials_edit"> > > [% IF ( Errors ) %] > <div class="dialog alert"> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/prevent_submit.js b/koha-tmpl/intranet-tmpl/prog/js/prevent_submit.js >deleted file mode 100644 >index 8ca0def535..0000000000 >--- a/koha-tmpl/intranet-tmpl/prog/js/prevent_submit.js >+++ /dev/null >@@ -1,11 +0,0 @@ >-$(document).ready(function() { >- // We don't want to apply this for the search form >- $("#doc3 form").keypress(function (e) { >- if( e.which == 13 >- && e.target.nodeName == "INPUT" >- && e.target.type != "submit" >- ) { >- return false; >- } >- }); >-}); >-- >2.11.0
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 15911
:
85539
|
86046
|
86205
| 86412 |
86413