|
Lines 101-108
$(document).ready(function(){
Link Here
|
| 101 |
// If not, we add the subfield to the first matching field |
101 |
// If not, we add the subfield to the first matching field |
| 102 |
var where = 0; |
102 |
var where = 0; |
| 103 |
$("#resultul li span.field").each(function() { |
103 |
$("#resultul li span.field").each(function() { |
| 104 |
if (where == 0 && $(this).text() == field) { |
104 |
if ($(this).text() == field) { |
| 105 |
where = this; |
105 |
where = this; |
|
|
106 |
return false; // break each() |
| 106 |
} |
107 |
} |
| 107 |
}); |
108 |
}); |
| 108 |
|
109 |
|
|
Lines 127-140
$(document).ready(function(){
Link Here
|
| 127 |
} else { |
128 |
} else { |
| 128 |
// If we are a field |
129 |
// If we are a field |
| 129 |
var where = 0; |
130 |
var where = 0; |
| 130 |
// Find where to add the field |
131 |
// Find a greater field to add before |
| 131 |
$("#resultul li span.field").each(function() { |
132 |
$("#resultul li span.field").each(function() { |
| 132 |
if (where == 0 && $(this).text() > field) { |
133 |
if ($(this).text() > field) { |
| 133 |
where = this; |
134 |
where = this; |
| 134 |
} |
135 |
return false; // break each() |
| 135 |
}); |
136 |
} |
|
|
137 |
}); |
| 138 |
if (where) { |
| 139 |
$(where).parent().before(clone); |
| 140 |
} else { |
| 141 |
// No greater field, add to the end |
| 142 |
$("#resultul").append(clone); |
| 143 |
} |
| 136 |
|
144 |
|
| 137 |
$(where).parent().before(clone); |
|
|
| 138 |
} |
145 |
} |
| 139 |
} |
146 |
} |
| 140 |
} else { |
147 |
} else { |
| 141 |
- |
|
|