Merged revisions 50812 via svnmerge from

http://svn.silverstripe.com/open/modules/cms/branches/2.2.2

........
  r50812 | sminnee | 2008-03-11 10:34:32 +1300 (Tue, 11 Mar 2008) | 1 line
  
  #2285 - Fixed widget editor
........


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@50854 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-03-11 01:20:53 +00:00
parent 0ea65564f7
commit 32024b451c
3 changed files with 11 additions and 6 deletions

View File

@ -12,12 +12,16 @@ div.usedWidgetsHolder {
}
div.usedWidgets {
min-height: 100px;
border: 1px #CCC dotted;
padding: 5px;
}
#NoWidgets {
padding: 50px; /* Make this nice and big and easily 'droppable' */
}
div.usedWidgets div.Widget,
div.availableWidgets div.Widget {
width: 90%;
width: 98%;
border: 1px solid #ddd;
border-top: none;
margin-bottom: 5px;

View File

@ -61,7 +61,7 @@ WidgetAreaEditor.prototype = {
for(var i = 0; i < usedWidgets.length; i++) {
var widget = usedWidgets[i];
if(widget.id && (widget.id.indexOf("Widget[") != 0)) {
new Ajax.Request(widget.id + "/EditableSegment", {onSuccess : $('WidgetAreaEditor_usedWidgets').parentNode.parentNode.insertWidgetEditor.bind(this)});
new Ajax.Request('Widget_Controller/EditableSegment/' + widget.id, {onSuccess : $('WidgetAreaEditor_usedWidgets').parentNode.parentNode.insertWidgetEditor.bind(this)});
}
}
},

View File

@ -2,6 +2,7 @@
<input type="hidden" id="$Name" name="$IdxField" value="$Value" />
<div class="availableWidgetsHolder">
<h2><% _t('AVAILABLE', 'Available Widgets') %></h2>
<p>&nbsp;</p>
<div class="availableWidgets" id="WidgetAreaEditor_availableWidgets">
<% if AvailableWidgets %>
<% control AvailableWidgets %>
@ -16,15 +17,15 @@
</div>
<div class="usedWidgetsHolder">
<h2><% _t('INUSE', 'Widgets currently used') %></h2>
<p><% _t('TOADD', 'To add widgets, drag them from the left area to here.') %></p>
<div class="usedWidgets" id="WidgetAreaEditor_usedWidgets">
<% if UsedWidgets %>
<% control UsedWidgets %>
$EditableSegment
<% end_control %>
<% else %>
<div id="NoWidgets">
<p><% _t('TOADD', 'To add widgets, drag them from the left area to here.') %></p>
</div>
<div id="NoWidgets"></div>
<% end_if %>
</div>
</div>