From 663c6426034832f059b77ae94885967df80cd7a2 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 --- 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 b685c2ac73..8ebd4c95b0 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.17.1