mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUGFIX Fixed sortWidgets() function in WidgetAreaEditor not working because it was picking up comment nodes
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@66828 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
13d0f09717
commit
43058e137c
@ -103,17 +103,23 @@ WidgetAreaEditor.prototype = {
|
||||
// Order the sort by the order the widgets are in the list
|
||||
var usedWidgets = $('WidgetAreaEditor_usedWidgets');
|
||||
|
||||
if (usedWidgets) {
|
||||
if(usedWidgets) {
|
||||
widgets = usedWidgets.childNodes;
|
||||
|
||||
for( i = 0; div = widgets[i]; i++ ) {
|
||||
for(i = 0; i < widgets.length; i++) {
|
||||
var div = widgets[i];
|
||||
|
||||
if(div.nodeName != '#comment') {
|
||||
var fields = div.getElementsByTagName('input');
|
||||
for( j = 0; field = fields.item(j); j++ ) {
|
||||
if( field.name == div.id + '[Sort]' ) {
|
||||
|
||||
for(j = 0; field = fields.item(j); j++) {
|
||||
if(field.name == div.id + '[Sort]') {
|
||||
field.value = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user