Bug 17817: (Follow up) Fix reordering subfields issues
authorPatricio Marrone <pmarrone@unc.edu.ar>
Wed, 11 Jan 2017 15:39:21 +0000 (12:39 -0300)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 13 Jan 2017 11:23:00 +0000 (11:23 +0000)
Authority controlled subfields have invisible divs which produced
a strange behavior when reordering (multiple clicks were needed
to push a subfield up over an authority controlled subfield)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/js/cataloging.js

index 6fd9346..ed43aec 100644 (file)
@@ -443,7 +443,7 @@ function upSubfield(index) {
     var tag = line.parentNode; // get the dad of this line. (should be "<div id='tag_...'>")
 
     // getting all visible subfields for this tag
-    var subfields = tag.querySelectorAll("div.subfield_line");
+    var subfields = tag.querySelectorAll("div.subfield_line:not( [style*='display:none;'] )");
     var subfieldsLength = subfields.length;
 
     if(subfieldsLength<=1) return; // nothing to do if there is just one subfield.