How to use the metal-dom.addClasses function in metal-dom

To help you get started, we’ve selected a few metal-dom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LiferayCloud / marble / packages / marble-alert / src / Alert.js View on Github external
let showOrHide = () => {
      if (this.isDisposed()) {
        return;
      }

      dom.removeClasses(
        this.element,
        this.animClasses[visible ? 'hide' : 'show']
      );
      dom.addClasses(this.element, this.animClasses[visible ? 'show' : 'hide']);

      // Some browsers do not fire transitionend events when running in background
      // tab, see https://bugzilla.mozilla.org/show_bug.cgi?id=683696.
      Anim.emulateEnd(this.element);

      if (visible && core.isNumber(this.hideDelay)) {
        this.syncHideDelay(this.hideDelay);
      }
    };
github LiferayCloud / marble / packages / marble-reading-progress / src / ReadingProgressTracker.js View on Github external
updateCompleted() {
    for (let i = 0; i < this.regions.length; i++) {
      let element = this.resolveElement(this.regions[i].link);
      if (i < this.activeIndex) {
        dom.addClasses(element, this.completedClass);
      } else {
        dom.removeClasses(element, this.completedClass);
      }
    }
  }
github LiferayCloud / marble / packages / marble-autocomplete / src / Autocomplete.js View on Github external
dom.removeClasses(this.element, this.positionCss_);
    switch (position) {
    case Align.Top:
    case Align.TopLeft:
    case Align.TopRight:
      this.positionCss_ = 'autocomplete-top';
      break;
    case Align.Bottom:
    case Align.BottomLeft:
    case Align.BottomRight:
      this.positionCss_ = 'autocomplete-bottom';
      break;
    default:
      this.positionCss_ = null;
    }
    dom.addClasses(this.element, this.positionCss_);
  }
github LiferayCloud / marble / packages / marble-tooltip / src / Tooltip.js View on Github external
setTimeout(() => {
      if (visible) {
        dom.addClasses(this.element, 'showing');
      } else {
        dom.removeClasses(this.element, 'showing');
      }
    }, 20);
  }