MINOR fixed bug where widget area editor would not be activated

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@94829 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Tom Rix 2009-12-10 00:29:32 +00:00 committed by Sam Minnee
parent 7d48f2c1c8
commit 6c160db322

View File

@ -6,7 +6,6 @@ WidgetAreaEditorClass.prototype = {
this.rewriteWidgetAreaAttributes();
UsedWidget.applyToChildren($('usedWidgets-'+this.name), 'div.Widget');
// Make available widgets draggable
var availableWidgets = $('availableWidgets-'+this.name).childNodes;
for(var i = 0; i < availableWidgets.length; i++) {
@ -113,8 +112,8 @@ WidgetAreaEditorClass.prototype = {
if ($('WidgetAreaEditor-'+holder).getAttribute('maxwidgets')) {
var maxCount = $('WidgetAreaEditor-'+holder).getAttribute('maxwidgets');
var count = $$('#usedWidgets-'+holder+' .Widget').length;
if (count > maxCount) {
alert('Sorry, you have reached the maximum number of widgets in this area');
if (count+1 > maxCount) {
alert(ss.i18n._t('WidgetAreaEditor.TOOMANY'));
return;
}
}
@ -254,11 +253,4 @@ WidgetTreeDropdownField.prototype = {
}
WidgetTreeDropdownField.applyTo('div.usedWidgets .TreeDropdownField');
// Loop over all WidgetAreas and fire 'em up
var wAs = $$('.WidgetAreaEditor');
for(var i = 0; i < wAs.length; i++) {
WidgetAreaEditorClass.applyTo('div#'+wAs[i].id);
}
WidgetAreaEditorClass.applyTo('.WidgetAreaEditor');