Lines 79-86
function toggleField(pField) {
Link Here
|
79 |
// If not, we add the subfield to the first matching field |
79 |
// If not, we add the subfield to the first matching field |
80 |
var where = 0; |
80 |
var where = 0; |
81 |
$("#resultul li span.field").each(function() { |
81 |
$("#resultul li span.field").each(function() { |
82 |
if (where == 0 && $(this).text() == field) { |
82 |
if ($(this).text() == field) { |
83 |
where = this; |
83 |
where = this; |
|
|
84 |
return false; // break each() |
84 |
} |
85 |
} |
85 |
}); |
86 |
}); |
86 |
|
87 |
|
Lines 102-115
function toggleField(pField) {
Link Here
|
102 |
} else { |
103 |
} else { |
103 |
// If we are a field |
104 |
// If we are a field |
104 |
var where = 0; |
105 |
var where = 0; |
105 |
// Find where to add the field |
106 |
// Find a greater field to add before |
106 |
$("#resultul li span.field").each(function() { |
107 |
$("#resultul li span.field").each(function() { |
107 |
if (where == 0 && $(this).text() > field) { |
108 |
if ($(this).text() > field) { |
108 |
where = this; |
109 |
where = this; |
|
|
110 |
return false; // break each() |
109 |
} |
111 |
} |
110 |
}); |
112 |
}); |
111 |
|
113 |
if (where) { |
112 |
$(where).parent().before(clone); |
114 |
$(where).parent().before(clone); |
|
|
115 |
} else { |
116 |
// No greater field, add to the end |
117 |
$("#resultul").append(clone); |
118 |
} |
113 |
} |
119 |
} |
114 |
} |
120 |
} |
115 |
} else { |
121 |
} else { |
116 |
- |
|
|