diff --git a/code/form/WidgetAreaEditor.php b/code/form/WidgetAreaEditor.php index 4edc40f..bc0cff7 100644 --- a/code/form/WidgetAreaEditor.php +++ b/code/form/WidgetAreaEditor.php @@ -40,7 +40,7 @@ class WidgetAreaEditor extends FormField { foreach($this->widgetClasses as $widgetClass) { $classes = ClassInfo::subclassesFor($widgetClass); - array_shift($classes); + if(count($classes) > 1) array_shift($classes); foreach($classes as $class) { $widgets->push(singleton($class)); } diff --git a/javascript/WidgetAreaEditor.js b/javascript/WidgetAreaEditor.js index 0af952a..a041cf1 100644 --- a/javascript/WidgetAreaEditor.js +++ b/javascript/WidgetAreaEditor.js @@ -132,7 +132,7 @@ $(this).data('maxid', newID); var widgetContent = response.replace(/Widget\[0\]/gi, "Widget[new-" + (newID) + "]"); - $('#usedWidgets-'+$(this).attr('name')).prepend(widgetContent); + $('#usedWidgets-'+$(this).attr('name')).append(widgetContent); this.rewriteWidgetAreaAttributes(); },