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