diff --git a/src/component/FlexContainerComponent.js b/src/component/FlexContainerComponent.js index 0f46425..e86f707 100644 --- a/src/component/FlexContainerComponent.js +++ b/src/component/FlexContainerComponent.js @@ -130,6 +130,33 @@ class FlexContainerComponent extends Component { return this; } + /** + * Adds, sets, updates or overwrites the Modification of/for the children of this component. + * Just calls .modifier(modifier) on each child. + * + * @param {Modifier} modifier + * @param {boolean|ExtStorage|ExtStoreType|OverwriteBehaviour} [extStore=null] + * @returns {FlexContainerComponent} this component object + */ + modifyChildren(modifier, underTheName = "", extStore = false) { + if (underTheName === "") { + underTheName = `.${this._compName}-style-children`; + } + if (!extStore) { + for (const child of this._children) { + child.modifier(modifier) + } + } else { + this.addStyleClass(underTheName); + this._styles.push( + new SStoreDefinition( + underTheName, + modifier.ensureModifier() + ) + ); + } + return this; + } /** * @override