mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
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:
parent
cad9f67a92
commit
86f752504c
@ -170,14 +170,13 @@ WidgetAreaEditorClass.prototype = {
|
|||||||
widget = document.createElement('div');
|
widget = document.createElement('div');
|
||||||
widget.innerHTML = response.responseText.replace(/Widget\[0\]/gi, "Widget[new-" + (++$('usedWidgets-'+this.name).parentNode.parentNode.maxid) + "]");
|
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();
|
$('usedWidgets-'+this.name).parentNode.parentNode.rewriteWidgetAreaAttributes();
|
||||||
UsedWidget.applyToChildren($('usedWidgets-'+this.name), 'div.Widget');
|
UsedWidget.applyToChildren($('usedWidgets-'+this.name), 'div.Widget');
|
||||||
|
|
||||||
// Repply some common form controls
|
// Repply some common form controls
|
||||||
WidgetTreeDropdownField.applyTo('div.usedWidgets .TreeDropdownField');
|
WidgetTreeDropdownField.applyTo('div.usedWidgets .TreeDropdownField');
|
||||||
|
|
||||||
|
|
||||||
Sortable.create('usedWidgets-'+this.name, {
|
Sortable.create('usedWidgets-'+this.name, {
|
||||||
tag: 'div',
|
tag: 'div',
|
||||||
handle: 'handle',
|
handle: 'handle',
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
<p><% _t('TOADD', 'To add widgets, click one on the left to add it here') %></p>
|
<p><% _t('TOADD', 'To add widgets, click one on the left to add it here') %></p>
|
||||||
|
|
||||||
<div class="usedWidgets" id="usedWidgets-$Name">
|
<div class="usedWidgets" id="usedWidgets-$Name">
|
||||||
|
<div id="usedWidgetsStart-$Name"><!-- --></div>
|
||||||
<% if UsedWidgets %>
|
<% if UsedWidgets %>
|
||||||
<% control UsedWidgets %>
|
<% control UsedWidgets %>
|
||||||
$EditableSegment
|
$EditableSegment
|
||||||
|
Loading…
Reference in New Issue
Block a user