mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#21226: Fixed that the Bindings tab doesn't appear for newly added form fields.
Work Item: 21226
This commit is contained in:
@@ -62,17 +62,20 @@ var LayoutEditor;
|
||||
this.children = children;
|
||||
_(this.children).each(function (child) {
|
||||
child.parent = self;
|
||||
|
||||
var getEditorObject = child.getEditorObject;
|
||||
child.getEditorObject = function () {
|
||||
var dto = getEditorObject();
|
||||
return $.extend(dto, {
|
||||
FormBindingContentType: self.formBindingContentType
|
||||
});
|
||||
};
|
||||
self.linkChild(child);
|
||||
});
|
||||
};
|
||||
|
||||
this.linkChild = function(element) {
|
||||
var getEditorObject = element.getEditorObject;
|
||||
element.getEditorObject = function () {
|
||||
var dto = getEditorObject();
|
||||
return $.extend(dto, {
|
||||
FormBindingContentType: self.formBindingContentType
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
this.setChildren(children);
|
||||
};
|
||||
|
||||
|
@@ -1 +1 @@
|
||||
angular.module("LayoutEditor").directive("orcLayoutForm",function(n,t,i){return{restrict:"E",scope:{element:"="},controller:function(n,i){t.configureForElement(n,i);t.configureForContainer(n,i);n.sortableOptions.axis="y";n.edit=function(){n.$root.editElement(n.element).then(function(t){t.cancel||(n.element.data=decodeURIComponent(t.element.data),n.element.name=t.elementEditorModel.name,n.element.formBindingContentType=t.elementEditorModel.formBindingContentType,n.$apply())})}},templateUrl:i.templateUrl("Form"),replace:!0}});var LayoutEditor;(function(n,t){t.Form=function(i,r,u,f,e,o,s,h,c,l,a,v){var y,p;t.Element.call(this,"Form",i,r,u,f,e);t.Container.call(this,["Grid","Content"],v);y=this;this.isContainable=!0;this.dropTargetClass="layout-common-holder";this.contentType=h;this.contentTypeLabel=c;this.contentTypeClass=l;this.name=o||"Untitled";this.formBindingContentType=s;this.hasEditor=a;this.toObject=function(){var n=this.elementToObject();return n.name=this.name,n.formBindingContentType=this.formBindingContentType,n.children=this.childrenToObject(),n};p=this.getEditorObject;this.getEditorObject=function(){var t=p();return n.extend(t,{FormName:this.name,FormBindingContentType:this.formBindingContentType})};this.setChildren=function(t){this.children=t;_(this.children).each(function(t){t.parent=y;var i=t.getEditorObject;t.getEditorObject=function(){var t=i();return n.extend(t,{FormBindingContentType:y.formBindingContentType})}})};this.setChildren(v)};t.Form.from=function(n){return new t.Form(n.data,n.htmlId,n.htmlClass,n.htmlStyle,n.isTemplated,n.name,n.formBindingContentType,n.contentType,n.contentTypeLabel,n.contentTypeClass,n.hasEditor,t.childrenFrom(n.children))};t.registerFactory("Form",function(n){return t.Form.from(n)})})(jQuery,LayoutEditor||(LayoutEditor={}));
|
||||
angular.module("LayoutEditor").directive("orcLayoutForm",function(n,t,i){return{restrict:"E",scope:{element:"="},controller:function(n,i){t.configureForElement(n,i);t.configureForContainer(n,i);n.sortableOptions.axis="y";n.edit=function(){n.$root.editElement(n.element).then(function(t){t.cancel||(n.element.data=decodeURIComponent(t.element.data),n.element.name=t.elementEditorModel.name,n.element.formBindingContentType=t.elementEditorModel.formBindingContentType,n.$apply())})}},templateUrl:i.templateUrl("Form"),replace:!0}});var LayoutEditor;(function(n,t){t.Form=function(i,r,u,f,e,o,s,h,c,l,a,v){var y,p;t.Element.call(this,"Form",i,r,u,f,e);t.Container.call(this,["Grid","Content"],v);y=this;this.isContainable=!0;this.dropTargetClass="layout-common-holder";this.contentType=h;this.contentTypeLabel=c;this.contentTypeClass=l;this.name=o||"Untitled";this.formBindingContentType=s;this.hasEditor=a;this.toObject=function(){var n=this.elementToObject();return n.name=this.name,n.formBindingContentType=this.formBindingContentType,n.children=this.childrenToObject(),n};p=this.getEditorObject;this.getEditorObject=function(){var t=p();return n.extend(t,{FormName:this.name,FormBindingContentType:this.formBindingContentType})};this.setChildren=function(n){this.children=n;_(this.children).each(function(n){n.parent=y;y.linkChild(n)})};this.linkChild=function(t){var i=t.getEditorObject;t.getEditorObject=function(){var t=i();return n.extend(t,{FormBindingContentType:y.formBindingContentType})}};this.setChildren(v)};t.Form.from=function(n){return new t.Form(n.data,n.htmlId,n.htmlClass,n.htmlStyle,n.isTemplated,n.name,n.formBindingContentType,n.contentType,n.contentTypeLabel,n.contentTypeClass,n.hasEditor,t.childrenFrom(n.children))};t.registerFactory("Form",function(n){return t.Form.from(n)})})(jQuery,LayoutEditor||(LayoutEditor={}));
|
@@ -37,17 +37,20 @@
|
||||
this.children = children;
|
||||
_(this.children).each(function (child) {
|
||||
child.parent = self;
|
||||
|
||||
var getEditorObject = child.getEditorObject;
|
||||
child.getEditorObject = function () {
|
||||
var dto = getEditorObject();
|
||||
return $.extend(dto, {
|
||||
FormBindingContentType: self.formBindingContentType
|
||||
});
|
||||
};
|
||||
self.linkChild(child);
|
||||
});
|
||||
};
|
||||
|
||||
this.linkChild = function(element) {
|
||||
var getEditorObject = element.getEditorObject;
|
||||
element.getEditorObject = function () {
|
||||
var dto = getEditorObject();
|
||||
return $.extend(dto, {
|
||||
FormBindingContentType: self.formBindingContentType
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
this.setChildren(children);
|
||||
};
|
||||
|
||||
|
@@ -264,8 +264,9 @@ angular
|
||||
// Should ideally call LayoutEditor.Container.addChild() instead, but since this handler
|
||||
// is run *before* the ui-sortable directive's handler, if we try to add the child to the
|
||||
// array that handler will get an exception when trying to do the same.
|
||||
// Because of this, we need to invoke "setParent" so that specific container types can perform element speficic initialization.
|
||||
receivedElement.setEditor(element.editor);
|
||||
receivedElement.parent = element;
|
||||
receivedElement.setParent(element);
|
||||
if (receivedElement.type == "Content" && !!receivedElement.hasEditor) {
|
||||
$scope.$root.editElement(receivedElement).then(function (args) {
|
||||
if (!args.cancel) {
|
||||
|
File diff suppressed because one or more lines are too long
@@ -233,8 +233,9 @@
|
||||
// Should ideally call LayoutEditor.Container.addChild() instead, but since this handler
|
||||
// is run *before* the ui-sortable directive's handler, if we try to add the child to the
|
||||
// array that handler will get an exception when trying to do the same.
|
||||
// Because of this, we need to invoke "setParent" so that specific container types can perform element speficic initialization.
|
||||
receivedElement.setEditor(element.editor);
|
||||
receivedElement.parent = element;
|
||||
receivedElement.setParent(element);
|
||||
if (receivedElement.type == "Content" && !!receivedElement.hasEditor) {
|
||||
$scope.$root.editElement(receivedElement).then(function (args) {
|
||||
if (!args.cancel) {
|
||||
|
@@ -100,6 +100,13 @@ var LayoutEditor;
|
||||
}
|
||||
};
|
||||
|
||||
this.setParent = function(parentElement) {
|
||||
this.parent = parentElement;
|
||||
|
||||
if (!!this.parent.linkChild)
|
||||
this.parent.linkChild(this);
|
||||
};
|
||||
|
||||
this.setIsTemplated = function (value) {
|
||||
this.isTemplated = value;
|
||||
if (!!this.children && _.isArray(this.children)) {
|
||||
|
File diff suppressed because one or more lines are too long
@@ -25,6 +25,13 @@
|
||||
}
|
||||
};
|
||||
|
||||
this.setParent = function(parentElement) {
|
||||
this.parent = parentElement;
|
||||
|
||||
if (!!this.parent.linkChild)
|
||||
this.parent.linkChild(this);
|
||||
};
|
||||
|
||||
this.setIsTemplated = function (value) {
|
||||
this.isTemplated = value;
|
||||
if (!!this.children && _.isArray(this.children)) {
|
||||
|
Reference in New Issue
Block a user