Sha256: 63afe6e53c2a0cb0afc63cce6c94ae089c7599dec6765c6a9363ac19a75975c7

Contents?: true

Size: 682 Bytes

Versions: 44

Compression:

Stored size: 682 Bytes

Contents

((exports) => {
  class AutoButtonsByMinItemsComponent {
    constructor(options = {}) {
      this.listSelector = options.listSelector;
      this.minItems = options.minItems;
      this.hideOnMinItemsOrLessSelector = options.hideOnMinItemsOrLessSelector;

      this.run();
    }

    run() {
      const $list = $(this.listSelector);
      const $items = $list.find(this.hideOnMinItemsOrLessSelector);

      if ($list.length <= this.minItems) {
        $items.hide();
      } else {
        $items.show();
      }
    }
  }

  exports.DecidimAdmin = exports.DecidimAdmin || {};
  exports.DecidimAdmin.AutoButtonsByMinItemsComponent = AutoButtonsByMinItemsComponent;
})(window);

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
decidim-surveys-0.11.2 app/assets/javascripts/decidim/surveys/admin/auto_buttons_by_min_items.component.js.es6
decidim-surveys-0.12.0.pre app/assets/javascripts/decidim/surveys/admin/auto_buttons_by_min_items.component.js.es6
decidim-surveys-0.11.1 app/assets/javascripts/decidim/surveys/admin/auto_buttons_by_min_items.component.js.es6
decidim-surveys-0.11.0.pre1 app/assets/javascripts/decidim/surveys/admin/auto_buttons_by_min_items.component.js.es6