Sha256: 4767c2087a1596f44aa84f6fa8a3d71c20b22cb3c1313931eebbe2a177b5d826

Contents?: true

Size: 843 Bytes

Versions: 17

Compression:

Stored size: 843 Bytes

Contents

ActiveAdmin.TableCheckboxToggler = class TableCheckboxToggler extends ActiveAdmin.CheckboxToggler {
  _bind() {
    super._bind(...arguments);

    this.$container
      .find('tbody td')
      .click(event => {
        if (event.target.type !== 'checkbox') {
          this._didClickCell(event.target);
        }
      });
  }

  _didChangeCheckbox(checkbox) {
    super._didChangeCheckbox(...arguments);

    $(checkbox)
      .parents('tr')
      .toggleClass('selected', checkbox.checked);
  }

  _didChangeToggleAllCheckbox() {
    this.$container
      .find('tbody tr')
      .toggleClass('selected', super._didChangeToggleAllCheckbox(...arguments));
  }

  _didClickCell(cell) {
    $(cell)
      .parent('tr')
      .find(':checkbox')
      .click();
  }
};

$.widget.bridge('tableCheckboxToggler', ActiveAdmin.TableCheckboxToggler);

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
activeadmin-rails-1.7.1 app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6
activeadmin-rails-1.7.0 app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6
activeadmin-2.4.0 app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6
activeadmin-2.3.1 app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6
activeadmin-2.3.0 app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6
activeadmin-2.2.0 app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6
activeadmin-2.1.0 app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6
activeadmin-2.0.0 app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6
activeadmin-2.0.0.rc2 app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6
activeadmin_addons-1.7.1 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6
activeadmin-2.0.0.rc1 app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6
activeadmin_addons-1.7.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6
activeadmin_addons-1.6.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6
activeadmin_addons-1.5.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6
activeadmin_addons-1.4.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6
activeadmin_addons-1.3.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6
activeadmin_addons-1.2.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/app/assets/javascripts/active_admin/lib/table-checkbox-toggler.es6