{I" class:EFI"ProcessedAsset;FI"logical_path;FI")active_admin/lib/checkbox-toggler.js;TI" pathname;FI"¥/Users/benoit/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/bundler/gems/activeadmin-7d968c2898cb/app/assets/javascripts/active_admin/lib/checkbox-toggler.js.coffee;TI"content_type;FI"application/javascript;FI" mtime;Fl+°àåTI" length;FigI" digest;F"%7d7460246618f0d2d55741842d3fc98fI" source;FI"g(function() { ActiveAdmin.CheckboxToggler = (function() { function CheckboxToggler(options, container) { var defaults; this.options = options; this.container = container; defaults = {}; this.options = $.extend(defaults, options); this._init(); this._bind(); } CheckboxToggler.prototype._init = function() { if (!this.container) { throw new Error('Container element not found'); } else { this.$container = $(this.container); } if (!this.$container.find('.toggle_all').length) { throw new Error('"toggle all" checkbox not found'); } else { this.toggle_all_checkbox = this.$container.find('.toggle_all'); } return this.checkboxes = this.$container.find(':checkbox').not(this.toggle_all_checkbox); }; CheckboxToggler.prototype._bind = function() { this.checkboxes.change((function(_this) { return function(e) { return _this._didChangeCheckbox(e.target); }; })(this)); return this.toggle_all_checkbox.change((function(_this) { return function() { return _this._didChangeToggleAllCheckbox(); }; })(this)); }; CheckboxToggler.prototype._didChangeCheckbox = function(checkbox) { switch (this.checkboxes.filter(':checked').length) { case this.checkboxes.length - 1: return this.toggle_all_checkbox.prop({ checked: null }); case this.checkboxes.length: return this.toggle_all_checkbox.prop({ checked: true }); } }; CheckboxToggler.prototype._didChangeToggleAllCheckbox = function() { var setting; setting = this.toggle_all_checkbox.prop('checked') ? true : null; return this.checkboxes.each((function(_this) { return function(index, el) { $(el).prop({ checked: setting }); return _this._didChangeCheckbox(el); }; })(this)); }; return CheckboxToggler; })(); $.widget.bridge('checkboxToggler', ActiveAdmin.CheckboxToggler); }).call(this); ;TI"dependency_digest;F"%711558965a4a336563e8bed2b334bfbbI"required_paths;F[I"¥/Users/benoit/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/bundler/gems/activeadmin-7d968c2898cb/app/assets/javascripts/active_admin/lib/checkbox-toggler.js.coffee;TI"dependency_paths;F[{I" path;FI"¥/Users/benoit/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/bundler/gems/activeadmin-7d968c2898cb/app/assets/javascripts/active_admin/lib/checkbox-toggler.js.coffee;TI" mtime;FI"2015-02-19T14:10:08+01:00;FI" digest;F"%f4a44bdb5ffdad34b3100c07bd699ca0I" _version;F"%a805bf9eb4f9751b8ea0c520b2a29a36