mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Incremental work on selectable elements.
This commit is contained in:
@@ -142,10 +142,14 @@ var LayoutEditor;
|
||||
return this.editor.focusedElement === this;
|
||||
};
|
||||
|
||||
this.allowSealedFocus = function() {
|
||||
return false;
|
||||
};
|
||||
|
||||
this.setIsFocused = function () {
|
||||
if (!this.editor)
|
||||
return;
|
||||
if (this.isTemplated && this.isTemplatedContainer != true)
|
||||
if (this.isTemplated && !this.allowSealedFocus())
|
||||
return;
|
||||
if (this.editor.isDragging || this.editor.inlineEditingIsActive || this.editor.isResizing)
|
||||
return;
|
||||
@@ -393,13 +397,16 @@ 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);
|
||||
this.isTemplatedContainer = true;
|
||||
|
||||
this.toObject = function () {
|
||||
var result = this.elementToObject();
|
||||
result.children = this.childrenToObject();
|
||||
return result;
|
||||
};
|
||||
|
||||
this.allowSealedFocus = function() {
|
||||
return this.children.length === 0;
|
||||
}
|
||||
};
|
||||
|
||||
LayoutEditor.Canvas.from = function (value) {
|
||||
@@ -742,7 +749,6 @@ var LayoutEditor;
|
||||
LayoutEditor.Column = function (data, htmlId, htmlClass, htmlStyle, isTemplated, width, offset, collapsible, rule, children) {
|
||||
LayoutEditor.Element.call(this, "Column", data, htmlId, htmlClass, htmlStyle, isTemplated, rule);
|
||||
LayoutEditor.Container.call(this, ["Grid", "Content"], children);
|
||||
this.isTemplatedContainer = true;
|
||||
this.width = width;
|
||||
this.offset = offset;
|
||||
this.collapsible = collapsible;
|
||||
@@ -751,6 +757,10 @@ var LayoutEditor;
|
||||
var _origWidth = 0;
|
||||
var _origOffset = 0;
|
||||
|
||||
this.allowSealedFocus = function () {
|
||||
return this.children.length === 0;
|
||||
}
|
||||
|
||||
this.beginChange = function () {
|
||||
if (!!_hasPendingChange)
|
||||
throw new Error("Column already has a pending change.");
|
||||
|
File diff suppressed because one or more lines are too long
@@ -4,13 +4,16 @@
|
||||
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);
|
||||
this.isTemplatedContainer = true;
|
||||
|
||||
this.toObject = function () {
|
||||
var result = this.elementToObject();
|
||||
result.children = this.childrenToObject();
|
||||
return result;
|
||||
};
|
||||
|
||||
this.allowSealedFocus = function() {
|
||||
return this.children.length === 0;
|
||||
}
|
||||
};
|
||||
|
||||
LayoutEditor.Canvas.from = function (value) {
|
||||
|
@@ -3,7 +3,6 @@
|
||||
LayoutEditor.Column = function (data, htmlId, htmlClass, htmlStyle, isTemplated, width, offset, collapsible, rule, children) {
|
||||
LayoutEditor.Element.call(this, "Column", data, htmlId, htmlClass, htmlStyle, isTemplated, rule);
|
||||
LayoutEditor.Container.call(this, ["Grid", "Content"], children);
|
||||
this.isTemplatedContainer = true;
|
||||
this.width = width;
|
||||
this.offset = offset;
|
||||
this.collapsible = collapsible;
|
||||
@@ -12,6 +11,10 @@
|
||||
var _origWidth = 0;
|
||||
var _origOffset = 0;
|
||||
|
||||
this.allowSealedFocus = function () {
|
||||
return this.children.length === 0;
|
||||
}
|
||||
|
||||
this.beginChange = function () {
|
||||
if (!!_hasPendingChange)
|
||||
throw new Error("Column already has a pending change.");
|
||||
|
@@ -66,10 +66,14 @@
|
||||
return this.editor.focusedElement === this;
|
||||
};
|
||||
|
||||
this.allowSealedFocus = function() {
|
||||
return false;
|
||||
};
|
||||
|
||||
this.setIsFocused = function () {
|
||||
if (!this.editor)
|
||||
return;
|
||||
if (this.isTemplated && this.isTemplatedContainer != true)
|
||||
if (this.isTemplated && !this.allowSealedFocus())
|
||||
return;
|
||||
if (this.editor.isDragging || this.editor.inlineEditingIsActive || this.editor.isResizing)
|
||||
return;
|
||||
|
Reference in New Issue
Block a user