mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-22 20:13:50 +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)
|
||||
return HttpNotFound();
|
||||
|
||||
int widgetPosition = _widgetsService.GetWidgets(layerId).Count() + 1;
|
||||
widgetPart.Position = widgetPosition.ToString();
|
||||
|
||||
widgetPart.LayerPart = _widgetsService.GetLayer(layerId);
|
||||
dynamic model = Services.ContentManager.BuildEditor(widgetPart);
|
||||
return View(model);
|
||||
|
@@ -28,7 +28,7 @@ namespace Orchard.Widgets.Models {
|
||||
/// <summary>
|
||||
/// The widget's position within the zone.
|
||||
/// </summary>
|
||||
[HiddenInput(DisplayValue = false)]
|
||||
[Required]
|
||||
public string Position
|
||||
{
|
||||
get { return Record.Position; }
|
||||
|
@@ -172,7 +172,7 @@ namespace Orchard.Widgets.Services {
|
||||
|
||||
private static void SwitchWidgetPositions(WidgetPart sourceWidget, WidgetPart targetWidget) {
|
||||
string tempPosition = sourceWidget.Record.Position;
|
||||
sourceWidget.Record.Position = targetWidget.ToString();
|
||||
sourceWidget.Record.Position = targetWidget.Record.Position;
|
||||
targetWidget.Record.Position = tempPosition;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user