mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-26 20:16:15 +08:00
Layout Canvas reusability improvements.
This enables child canvas elements to be moved around and removed.
This commit is contained in:
@@ -193,6 +193,10 @@ var LayoutEditor;
|
||||
this.editor.dropTargetElement = null;
|
||||
};
|
||||
|
||||
this.canDelete = function () {
|
||||
return !!this.parent;
|
||||
};
|
||||
|
||||
this.delete = function () {
|
||||
if (!!this.parent)
|
||||
this.parent.deleteChild(this);
|
||||
@@ -396,7 +400,9 @@ var LayoutEditor;
|
||||
|
||||
LayoutEditor.Canvas = function (data, htmlId, htmlClass, htmlStyle, isTemplated, rule, children) {
|
||||
LayoutEditor.Element.call(this, "Canvas", data, htmlId, htmlClass, htmlStyle, isTemplated, rule);
|
||||
LayoutEditor.Container.call(this, ["Grid", "Content"], children);
|
||||
LayoutEditor.Container.call(this, ["Canvas", "Grid", "Content"], children);
|
||||
|
||||
this.isContainable = true;
|
||||
|
||||
this.toObject = function () {
|
||||
var result = this.elementToObject();
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -3,7 +3,9 @@
|
||||
|
||||
LayoutEditor.Canvas = function (data, htmlId, htmlClass, htmlStyle, isTemplated, rule, children) {
|
||||
LayoutEditor.Element.call(this, "Canvas", data, htmlId, htmlClass, htmlStyle, isTemplated, rule);
|
||||
LayoutEditor.Container.call(this, ["Grid", "Content"], children);
|
||||
LayoutEditor.Container.call(this, ["Canvas", "Grid", "Content"], children);
|
||||
|
||||
this.isContainable = true;
|
||||
|
||||
this.toObject = function () {
|
||||
var result = this.elementToObject();
|
||||
|
||||
@@ -117,6 +117,10 @@
|
||||
this.editor.dropTargetElement = null;
|
||||
};
|
||||
|
||||
this.canDelete = function () {
|
||||
return !!this.parent;
|
||||
};
|
||||
|
||||
this.delete = function () {
|
||||
if (!!this.parent)
|
||||
this.parent.deleteChild(this);
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
<div class="layout-element-wrapper" ng-class="{'layout-container-empty': getShowChildrenPlaceholder()}">
|
||||
<ul class="layout-panel layout-panel-main">
|
||||
<li class="layout-panel-item layout-panel-label">Canvas</li>
|
||||
<li class="layout-panel-item layout-panel-label">@T("Canvas")</li>
|
||||
@Display()
|
||||
@Display(New.LayoutEditor_Template_Properties(ElementTypeName: "canvas"))
|
||||
<li class="layout-panel-item layout-panel-action" title="@T("Delete canvas (Del)")" ng-click="delete(element)" ng-show="element.canDelete()"><i class="fa fa-remove"></i></li>
|
||||
<li class="layout-panel-item layout-panel-action" title="@T("Move canvas up (Ctrl+Up)")" ng-click="element.moveUp()" ng-show="element.canMoveUp()"><i class="fa fa-chevron-up"></i></li>
|
||||
<li class="layout-panel-item layout-panel-action" title="@T("Move canvas down (Ctrl+Down)")" ng-click="element.moveDown()" ng-show="element.canMoveDown()"><i class="fa fa-chevron-down"></i></li>
|
||||
</ul>
|
||||
<div class="layout-container-children-placeholder">
|
||||
@T("This layout canvas is empty. To get started, drag a grid element from the toolbox and drop it here.")
|
||||
|
||||
Reference in New Issue
Block a user