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-forms-0.24.3 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.23.6 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.24.2 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.23.5 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.24.1 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.24.0 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.24.0.rc2 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.23.4 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.24.0.rc1 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.23.3 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.23.2 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.23.1 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.23.1.rc1 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.23.0 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.22.0 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.21.0 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.20.1 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.20.0 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.19.1 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
decidim-forms-0.18.1 app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6