o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1381142258.115239: @value"m {I" class:EFI"ProcessedAsset;FI"logical_path;FI")locomotive/views/shared/list_view.js;TI" pathname;FI"„/Users/papipo/.rvm/gems/ruby-1.9.3-p448/gems/locomotive_cms-2.1.0/app/assets/javascripts/locomotive/views/shared/list_view.js.coffee;TI"content_type;FI"application/javascript;FI" mtime;FI"2013-10-07T10:55:40+02:00;FI" length;Fi¡ I" digest;F"%6e7ba757170fef3e277954ac1f82384dI" source;FI"¡ (function() { var _base, _ref, __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; }; (_base = Locomotive.Views).Shared || (_base.Shared = {}); Locomotive.Views.Shared.ListView = (function(_super) { var _item_views; __extends(ListView, _super); function ListView() { _ref = ListView.__super__.constructor.apply(this, arguments); return _ref; } ListView.prototype.tagName = 'div'; _item_views = []; ListView.prototype.initialize = function() { _.bindAll(this, 'insert_item', 'remove_item'); this.collection.bind('add', this.insert_item); return this.collection.bind('remove', this.remove_item); }; ListView.prototype.template = function() {}; ListView.prototype.item_view_class = function() {}; ListView.prototype.render = function() { $(this.el).html(this.template()()); this.render_items(); return this; }; ListView.prototype.render_items = function() { var _this = this; if (this.collection.length === 0) { return this.$('.no-items').show(); } else { return this.collection.each(function(item) { return _this.insert_item(item); }); } }; ListView.prototype.insert_item = function(item) { var klass, view; klass = this.item_view_class(); view = new klass({ model: item, parent_view: this }); (this._item_views || (this._item_views = [])).push(view); this.$('.no-items').hide(); return this.$('ul').append(view.render().el); }; ListView.prototype.remove_item = function(item) { var view; if (this.collection.length === 0) { this.$('.no-items').show(); } view = _.find(this._item_views, function(tmp) { return tmp.model === item; }); if (view != null) { return view.remove(); } }; ListView.prototype.remove = function() { var _this = this; _.each(this._item_views, function(view) { return view.remove(); }); return ListView.__super__.remove.apply(this, arguments); }; return ListView; })(Backbone.View); }).call(this); ;TI"dependency_digest;F"%837f2050a1c5112927b96e4f00b5ca43I"required_paths;F[I"„/Users/papipo/.rvm/gems/ruby-1.9.3-p448/gems/locomotive_cms-2.1.0/app/assets/javascripts/locomotive/views/shared/list_view.js.coffee;TI"dependency_paths;F[{I" path;FI"„/Users/papipo/.rvm/gems/ruby-1.9.3-p448/gems/locomotive_cms-2.1.0/app/assets/javascripts/locomotive/views/shared/list_view.js.coffee;TI" mtime;FI"2013-10-07T10:55:40+02:00;FI" digest;F"%2e67875d150d54eb7cf033037aad00feI" _version;F"%ffd318ca8b794f42f5029101c2cf5d91