o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1357194976.3761978: @value"ù{I" class:EFI"ProcessedAsset;FI"logical_path;FI":active_admin/components/jquery.aa.checkbox-toggler.js;TI" pathname;FI"©/Users/ejholmes/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/activeadmin-0.5.1/app/assets/javascripts/active_admin/components/jquery.aa.checkbox-toggler.js.coffee;TI"content_type;FI"application/javascript;FI" mtime;FI"2012-12-24T12:19:46-08:00;FI" length;Fi­ I" digest;F"%84f5494c2dcadd5eef02f3d686cc8f68I" source;FI"­ (function() { window.AA.CheckboxToggler = AA.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() { var _this = this; this.checkboxes.bind("change", function(e) { return _this._didChangeCheckbox(e.target); }); return this.toggle_all_checkbox.bind("change", function(e) { return _this._didChangeToggleAllCheckbox(); }); }; CheckboxToggler.prototype._didChangeCheckbox = function(checkbox) { if (this.checkboxes.filter(":checked").length === this.checkboxes.length - 1) { return this._uncheckToggleAllCheckbox(); } else if (this.checkboxes.filter(":checked").length === this.checkboxes.length) { return this._checkToggleAllCheckbox(); } }; CheckboxToggler.prototype._didChangeToggleAllCheckbox = function() { if (this.toggle_all_checkbox.attr("checked") === "checked") { return this._checkAllCheckboxes(); } else { return this._uncheckAllCheckboxes(); } }; CheckboxToggler.prototype._uncheckToggleAllCheckbox = function() { return this.toggle_all_checkbox.removeAttr("checked"); }; CheckboxToggler.prototype._checkToggleAllCheckbox = function() { return this.toggle_all_checkbox.attr("checked", "checked"); }; CheckboxToggler.prototype._uncheckAllCheckboxes = function() { var _this = this; return this.checkboxes.each(function(index, el) { $(el).removeAttr("checked"); return _this._didChangeCheckbox(el); }); }; CheckboxToggler.prototype._checkAllCheckboxes = function() { var _this = this; return this.checkboxes.each(function(index, el) { $(el).attr("checked", "checked"); return _this._didChangeCheckbox(el); }); }; return CheckboxToggler; })(); (function($) { return $.widget.bridge('checkboxToggler', AA.CheckboxToggler); })(jQuery); }).call(this); ;TI"dependency_digest;F"%3bf5629c7e74b39946fdab39f8fe8f32I"required_paths;F[I"©/Users/ejholmes/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/activeadmin-0.5.1/app/assets/javascripts/active_admin/components/jquery.aa.checkbox-toggler.js.coffee;TI"dependency_paths;F[{I" path;FI"©/Users/ejholmes/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/activeadmin-0.5.1/app/assets/javascripts/active_admin/components/jquery.aa.checkbox-toggler.js.coffee;TI" mtime;FI"2012-12-24T12:19:46-08:00;FI" digest;F"%1f7a69275767edb7f09abf9e13283c7dI" _version;F"%6776f581a4329e299531e1d52aa59832