From 48ca15a4117bea00b24dbf01b550a020bd33ac06 Mon Sep 17 00:00:00 2001 From: Christophe Croullebois Date: Thu, 29 Aug 2019 15:23:01 +0200 Subject: [PATCH] Bug 23252: Adds noEnterSubmit class in ajax context In cataloging.js $(document).ready adds noEnterSubmit class. This does not work in ajax context, it works with $(document).ajaxSuccess. Test plan : 1) 1.1) Verify you have an item subfield linked to items.itemnotes, ie 952$z 1.2) Verify 952$z exists in ACQ framework 2) 2.1) Verify system preference "AcqCreateItem" is on "placing an order" 2.2) Go to an acquisition basket 2.3) Click "Add to basket" and "From a new (empty) record" 2.4) Go to "Item" block 2.5) Verify that $z has "noEnterSubmit" class 2.6) Verify that typing enter in $z does not submit the form 3) 3.1) Change system preference "AcqCreateItem" to "receiving an order" 3.2) Go to "Receive shipment" 3.3) Receive an order 3.4) Go to "Item" block 3.5) Verify that $z has "noEnterSubmit" class 3.6) Verify that typing enter in $z does not submit the form Signed-off-by: Kyle M Hall Signed-off-by: Bouzid Fergani --- koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js index b26c45b..be183af 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js +++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js @@ -559,4 +559,7 @@ function CheckMandatorySubfields(p){ $(document).ready(function() { $("input.input_marceditor, input.indicator").addClass('noEnterSubmit'); + $(document).ajaxSuccess(function() { + $("input.input_marceditor, input.indicator").addClass('noEnterSubmit'); + }); }); -- 2.7.4