BUGFIX When adding a new widget by clicking one of the available widgets, add it to the top of the currently used widgets instead of the bottom (from r97522)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@102722 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-13 22:00:34 +00:00
parent cad9f67a92
commit 86f752504c
2 changed files with 2 additions and 2 deletions

View File

@ -170,14 +170,13 @@ WidgetAreaEditorClass.prototype = {
widget = document.createElement('div');
widget.innerHTML = response.responseText.replace(/Widget\[0\]/gi, "Widget[new-" + (++$('usedWidgets-'+this.name).parentNode.parentNode.maxid) + "]");
$('usedWidgets-'+this.name).appendChild(widget.childNodes[0]);
$('usedWidgetsStart-'+this.name).appendChild(widget.childNodes[0]);
$('usedWidgets-'+this.name).parentNode.parentNode.rewriteWidgetAreaAttributes();
UsedWidget.applyToChildren($('usedWidgets-'+this.name), 'div.Widget');
// Repply some common form controls
WidgetTreeDropdownField.applyTo('div.usedWidgets .TreeDropdownField');
Sortable.create('usedWidgets-'+this.name, {
tag: 'div',
handle: 'handle',

View File

@ -20,6 +20,7 @@
<p><% _t('TOADD', 'To add widgets, click one on the left to add it here') %></p>
<div class="usedWidgets" id="usedWidgets-$Name">
<div id="usedWidgetsStart-$Name"><!-- --></div>
<% if UsedWidgets %>
<% control UsedWidgets %>
$EditableSegment