Fix error select-account widget is not supported in et2_menulist widget

This commit is contained in:
Hadi Nategh 2020-06-10 13:32:33 +02:00
parent 676be91387
commit 06d6887744
2 changed files with 16 additions and 8 deletions

View File

@ -624,14 +624,17 @@ var et2_selectAccount_ro = /** @class */ (function (_super) {
* Constructor * Constructor
*/ */
function et2_selectAccount_ro(_parent, _attrs, _child) { function et2_selectAccount_ro(_parent, _attrs, _child) {
var _this = _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_selectAccount_ro._attributes, _child || {})) || this; var _this = this;
/** /**
Resolve some circular dependency problems here Resolve some circular dependency problems here
selectAccount extends link, link is in a file that needs select, selectAccount extends link, link is in a file that needs select,
select has menulist wrapper, which needs to know about selectAccount before it allows it select has menulist wrapper, which needs to know about selectAccount before it allows it
*/ */
if (_parent.supportedWidgetClasses.indexOf(et2_selectAccount_ro) < 0) { if (_parent.supportedWidgetClasses.indexOf(et2_selectAccount_ro) < 0) {
_parent.supportedWidgetClasses.push(et2_selectAccount_ro); _parent.supportedWidgetClasses.push(et2_selectAccount_ro);
}
_this = _super.call(this, _parent, _attrs, et2_core_inheritance_1.ClassWithAttributes.extendAttributes(et2_selectAccount_ro._attributes, _child || {})) || this;
if (_parent.supportedWidgetClasses.indexOf(et2_selectAccount_ro) > 0) {
_parent.addChild(_this); _parent.addChild(_this);
} }
// Legacy options could have row count or empty label in first slot // Legacy options could have row count or empty label in first slot

View File

@ -773,9 +773,7 @@ export class et2_selectAccount_ro extends et2_link_string
*/ */
constructor(_parent : et2_widget, _attrs? : WidgetConfig, _child? : object) constructor(_parent : et2_widget, _attrs? : WidgetConfig, _child? : object)
{ {
super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_selectAccount_ro._attributes, _child || {})); /**
/**
Resolve some circular dependency problems here Resolve some circular dependency problems here
selectAccount extends link, link is in a file that needs select, selectAccount extends link, link is in a file that needs select,
select has menulist wrapper, which needs to know about selectAccount before it allows it select has menulist wrapper, which needs to know about selectAccount before it allows it
@ -783,6 +781,13 @@ export class et2_selectAccount_ro extends et2_link_string
if(_parent.supportedWidgetClasses.indexOf(et2_selectAccount_ro) < 0) if(_parent.supportedWidgetClasses.indexOf(et2_selectAccount_ro) < 0)
{ {
_parent.supportedWidgetClasses.push(et2_selectAccount_ro); _parent.supportedWidgetClasses.push(et2_selectAccount_ro);
}
super(_parent, _attrs, ClassWithAttributes.extendAttributes(et2_selectAccount_ro._attributes, _child || {}));
if(_parent.supportedWidgetClasses.indexOf(et2_selectAccount_ro) > 0)
{
_parent.addChild(this); _parent.addChild(this);
} }