mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-24 13:33:34 +08:00
Fix issue with widget positions
Widget position are in a somewhat usable state now. --HG-- branch : dev
This commit is contained in:
@@ -111,6 +111,9 @@ namespace Orchard.Widgets.Controllers {
|
|||||||
if (widgetPart == null)
|
if (widgetPart == null)
|
||||||
return HttpNotFound();
|
return HttpNotFound();
|
||||||
|
|
||||||
|
int widgetPosition = _widgetsService.GetWidgets(layerId).Count() + 1;
|
||||||
|
widgetPart.Position = widgetPosition.ToString();
|
||||||
|
|
||||||
widgetPart.LayerPart = _widgetsService.GetLayer(layerId);
|
widgetPart.LayerPart = _widgetsService.GetLayer(layerId);
|
||||||
dynamic model = Services.ContentManager.BuildEditor(widgetPart);
|
dynamic model = Services.ContentManager.BuildEditor(widgetPart);
|
||||||
return View(model);
|
return View(model);
|
||||||
|
@@ -28,7 +28,7 @@ namespace Orchard.Widgets.Models {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The widget's position within the zone.
|
/// The widget's position within the zone.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[HiddenInput(DisplayValue = false)]
|
[Required]
|
||||||
public string Position
|
public string Position
|
||||||
{
|
{
|
||||||
get { return Record.Position; }
|
get { return Record.Position; }
|
||||||
|
@@ -172,7 +172,7 @@ namespace Orchard.Widgets.Services {
|
|||||||
|
|
||||||
private static void SwitchWidgetPositions(WidgetPart sourceWidget, WidgetPart targetWidget) {
|
private static void SwitchWidgetPositions(WidgetPart sourceWidget, WidgetPart targetWidget) {
|
||||||
string tempPosition = sourceWidget.Record.Position;
|
string tempPosition = sourceWidget.Record.Position;
|
||||||
sourceWidget.Record.Position = targetWidget.ToString();
|
sourceWidget.Record.Position = targetWidget.Record.Position;
|
||||||
targetWidget.Record.Position = tempPosition;
|
targetWidget.Record.Position = tempPosition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user