o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1357654410.735919L: @value"2 {I" class:EFI"BundledAsset;FI"logical_path;FI"8iugu-ux/components/usecode/iugu-ui-search-filter.js;FI" pathname;FI"€/Users/patricknegri/Desenvolvimento/iugu-ux/vendor/assets/javascripts/iugu-ux/components/usecode/iugu-ui-search-filter.js.coffee;FI"content_type;FI"application/javascript;FI" mtime;FI"2013-01-08T11:07:42-02:00;FI" length;Fi I" digest;F"%0d3356914f7570fa2e99fae219094222I" source;FI" (function() { var __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; IuguUI.SearchFilter = (function(_super) { __extends(SearchFilter, _super); function SearchFilter() { return SearchFilter.__super__.constructor.apply(this, arguments); } SearchFilter.prototype.layout = "iugu-ui-search-filter"; SearchFilter.prototype.defaults = { filterName: "age", fixedFilters: [], multiSelection: false }; SearchFilter.prototype.events = { 'click .search-filter-button': 'searchCollection' }; SearchFilter.prototype.searchCollection = function(e) { var button, filter; e.preventDefault(); button = $(e.target); filter = button.data('filter'); if (!this.options.multiSelection) { this.selected = []; } if (_.indexOf(this.selected, filter.toString()) !== -1) { this.selected = _.without(this.selected, filter.toString()); } else { this.selected.push(filter.toString()); } if (this.selected.length > 0) { this.collection.configureFilter(this.options.filterName + '_filter', this.selected); } else { this.collection.removeFilter(this.options.filterName + '_filter'); } return this.collection.fetch(); }; SearchFilter.prototype.initialize = function() { this.selected = []; _.bindAll(this, 'searchCollection', 'render'); this.collection.on('all', this.render, this); this.collection.on("removed-filter:" + this.options.filterName + "_filter", this.removedFilter, this); SearchFilter.__super__.initialize.apply(this, arguments); return this; }; SearchFilter.prototype.context = function() { return { collection: this.collection, selected: this.selected, filterName: this.options.filterName, fixedFilters: this.options.fixedFilters }; }; SearchFilter.prototype.render = function() { if (this.collection.facets) { return SearchFilter.__super__.render.apply(this, arguments); } }; SearchFilter.prototype.removedFilter = function() { return this.selected = []; }; return SearchFilter; })(IuguUI.Base); this.IuguUI.SearchFilter = IuguUI.SearchFilter; }).call(this); ;FI"required_assets_digest;F"%27fcc579f5cddb59d018d9677c5faef5I" _version;F"%9f3b95dd7ea3030dc35985c0a8020862