View | Details | Raw Unified | Return to bug 22666
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt (-1 / +25 lines)
Lines 110-116 Link Here
110
                        i++;
110
                        i++;
111
                    });
111
                    });
112
                }
112
                }
113
114
                function ReOrderSubField(){
115
                    var isFirst=1;
116
                    var subfield_start = $(field_start).children('ul')[0];
117
                    var first = subfield_start.firstElementChild;
118
119
                    [% FOREACH SUBFIELD IN SUBFIELD_LOOP %]
120
                        // grab all subfields
121
                        var subfield_name = "[% To.json(tag_number) | $raw %][% To.json(SUBFIELD.marc_subfield) | $raw %]"
122
                        var re = new RegExp('^subfield' + subfield_name,'g');
123
                        var subfields = $(subfield_start).children('li').filter( function() {return this.id.match(re); });
124
                        for (var i=0; i<subfields.length; i++){
125
                            var subfield = subfields[i];
126
                            if (isFirst ==1){
127
                                first = subfield_start.insertBefore(subfield, first);
128
                                isFirst=0;
129
                            }
130
                            else{
131
                                first = subfield_start.insertBefore(subfield, first.nextSibling);
132
                            }
133
                        }
134
                    [% END %]
135
                }
136
113
                [% UNLESS ( clear ) %]
137
                [% UNLESS ( clear ) %]
138
                    ReOrderSubField()
114
                    [% FOREACH SUBFIELD_LOO IN SUBFIELD_LOOP %]
139
                    [% FOREACH SUBFIELD_LOO IN SUBFIELD_LOOP %]
115
                        SetSubfieldValues(
140
                        SetSubfieldValues(
116
                            "[% To.json(tag_number) | $raw %][% To.json(SUBFIELD_LOO.marc_subfield) | $raw %]"
141
                            "[% To.json(tag_number) | $raw %][% To.json(SUBFIELD_LOO.marc_subfield) | $raw %]"
117
- 

Return to bug 22666