From 32024b451cfb19f5e4992a029f30ad9dbf45981e Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 11 Mar 2008 01:20:53 +0000 Subject: [PATCH] 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 --- css/WidgetAreaEditor.css | 8 ++++++-- javascript/WidgetAreaEditor.js | 2 +- templates/WidgetAreaEditor.ss | 7 ++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/css/WidgetAreaEditor.css b/css/WidgetAreaEditor.css index e1523d13..9f2bf54a 100644 --- a/css/WidgetAreaEditor.css +++ b/css/WidgetAreaEditor.css @@ -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; diff --git a/javascript/WidgetAreaEditor.js b/javascript/WidgetAreaEditor.js index 41edbf67..d3b6b685 100644 --- a/javascript/WidgetAreaEditor.js +++ b/javascript/WidgetAreaEditor.js @@ -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)}); } } }, diff --git a/templates/WidgetAreaEditor.ss b/templates/WidgetAreaEditor.ss index 2c002f5b..7defcdc5 100644 --- a/templates/WidgetAreaEditor.ss +++ b/templates/WidgetAreaEditor.ss @@ -2,6 +2,7 @@

<% _t('AVAILABLE', 'Available Widgets') %>

+

 

<% if AvailableWidgets %> <% control AvailableWidgets %> @@ -16,15 +17,15 @@

<% _t('INUSE', 'Widgets currently used') %>

+

<% _t('TOADD', 'To add widgets, drag them from the left area to here.') %>

+
<% if UsedWidgets %> <% control UsedWidgets %> $EditableSegment <% end_control %> <% else %> -
-

<% _t('TOADD', 'To add widgets, drag them from the left area to here.') %>

-
+
<% end_if %>