mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +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
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@97522 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c9bf87fd1a
commit
d02f174f42
@ -169,14 +169,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