Browse Source

FEAT: added hidden() and overflow() functions

master
chris 2 months ago
parent
commit
3782344e1f
  1. 32
      src/component.js

32
src/component.js

@ -84,6 +84,38 @@ class Component extends StyleAndScriptStoringComponent {
return this;
}
/**
*
* @param {boolean} vertical Defines if the Component should overflow vertically (default: true)
* @param {boolean} horizontal Defines if the Component should overflow horizontally (default: false)
* @returns {Component}
*/
overflow(vertical = true, horizontal = false) {
if (vertical) {
this._modifier._modifications["overflow-y"] = "auto";
}
if (horizontal) {
this._modifier._modifications["overflow-x"] = "auto";
}
return this;
}
/**
*
* @param {boolean} untilFound
* @returns {Component}
*/
hidden(untilFound = false) {
this._modifier.removeStyleRule("display");
this.setAttribute(
"hidden",
(untilFound ? "until-found" : "hidden")
);
return this;
}
/**
*
* @returns {Component}

Loading…
Cancel
Save