Browse Source

REFA: changed extStore setup

dev-feat-component_preview
chris 2 months ago
parent
commit
db5750ca16
  1. 3
      src/component/Component.js
  2. 13
      src/component/addStyleAndFunctions.js
  3. 11
      src/generators/generator.js

3
src/component/Component.js

@ -420,9 +420,6 @@ class Component extends StyleAndScriptStoringComponent {
let _wenity = new WebTrinity(); let _wenity = new WebTrinity();
if (!styleStore) {
styleStore = this._stylesExtStore;
}
/* DEAL WITH COMPONENT MODIFICATION FIRST */ /* DEAL WITH COMPONENT MODIFICATION FIRST */
// @todo pay attention to the "overwrite" behaviour - the local modifier styles are the "closest" // @todo pay attention to the "overwrite" behaviour - the local modifier styles are the "closest"

13
src/component/addStyleAndFunctions.js

@ -45,23 +45,10 @@ class StyleAndScriptStoringComponent extends ModifiableComponent {
constructor(element, attr = {}) { constructor(element, attr = {}) {
super(element, attr); super(element, attr);
this._styleClassesExtStore = ExtStoreType.CENTRALIZED_DOC_HEAD
.setOverwriteBehaviour(OverwriteBehaviour.REPLACE);
this._isClassESDefault = true; this._isClassESDefault = true;
this._stylesExtStore = ExtStoreType.INTERNALIZED_WITHIN
.setOverwriteBehaviour(OverwriteBehaviour.REPLACE);
this._isStyleESDefault = true; this._isStyleESDefault = true;
this._styles = []; this._styles = [];
this._functionsExtStore = ExtStoreType.CENTRALIZED_DOC_HEAD
.setOverwriteBehaviour(OverwriteBehaviour.REPLACE);
this._isFunESDefault = true; this._isFunESDefault = true;
this._functions = []; this._functions = [];
} }

11
src/generators/generator.js

@ -15,10 +15,15 @@
*/ */
class CompelGenerator { class CompelGenerator {
/** /**
* @param {null} [styleStore=null] * @param {ExtStorage} styleStore default ExtStoreType.INTERNALIZED_WITHIN
* @param {null} [functionStore=null] * @param {ExtStorage} functionStore default ExtStoreType.CENTRALIZED_DOC_HEAD
*/ */
constructor(styleStore = null, functionStore = null) { constructor(
styleStore = ExtStoreType.INTERNALIZED_WITHIN
.setOverwriteBehaviour(OverwriteBehaviour.REPLACE),
functionStore = ExtStoreType.CENTRALIZED_DOC_HEAD
.setOverwriteBehaviour(OverwriteBehaviour.REPLACE)
) {
this._styleStore = styleStore; this._styleStore = styleStore;
this._functionStore = functionStore; this._functionStore = functionStore;
} }

Loading…
Cancel
Save