Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX When adding a new widget by clicking one of the available widg…

…ets, 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
  • Loading branch information...
commit 86f752504cd3b85eacdb1310451a8dd9b1970b4e 1 parent cad9f67
@chillu chillu authored
Showing with 2 additions and 2 deletions.
  1. +1 −2  javascript/WidgetAreaEditor.js
  2. +1 −0  templates/WidgetAreaEditor.ss
View
3  javascript/WidgetAreaEditor.js
@@ -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
1  templates/WidgetAreaEditor.ss
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.