o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1384182739.8561192: @value"–{I" class:ETI"ProcessedAsset;FI"logical_path;TI"8locomotive/views/editable_elements/edit_all_view.js;FI" pathname;TI"¨/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.1/app/assets/javascripts/locomotive/views/editable_elements/edit_all_view.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;TI"2013-11-11T00:40:29+01:00;TI" length;Ti;I" digest;TI"%1e213a5a0e38770d0e66af6cb9721373;FI" source;TI";(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).EditableElements || (_base.EditableElements = {}); Locomotive.Views.EditableElements.EditAllView = (function(_super) { __extends(EditAllView, _super); function EditAllView() { _ref = EditAllView.__super__.constructor.apply(this, arguments); return _ref; } EditAllView.prototype.id = 'editable-elements'; EditAllView.prototype.tagName = 'div'; EditAllView.prototype._editable_elements_views = []; EditAllView.prototype.render = function() { if (this.collection.isEmpty()) { $(this.el).hide(); } else { this.blocks = this.collection.blocks(); $(this.el).html(ich.editable_elements_edit({ blocks: this.blocks })); this.render_elements(); this.enable_nav(); } return this; }; EditAllView.prototype.after_render = function() { var _this = this; return _.each(this._editable_elements_views, function(view) { return view.after_render(); }); }; EditAllView.prototype.refresh = function() { var _this = this; return _.each(this._editable_elements_views, function(view) { view.model = _this.collection.get(view.model.get('id')); return view.refresh(); }); }; EditAllView.prototype.unbind_model = function() { var _this = this; return _.each(this._editable_elements_views, function(view) { return Backbone.ModelBinding.unbind(view); }); }; EditAllView.prototype.render_elements = function() { var index, _this = this; index = 0; return _.each(this.blocks, function(block) { var list; list = _this.collection.by_block(block.name); return _.each(list, function(element) { var view, view_class; element.set({ index: index }); view_class = (function() { switch (element.get('type')) { case 'EditableText': return Locomotive.Views.EditableElements.TextView; case 'EditableFile': return Locomotive.Views.EditableElements.FileView; case 'EditableControl': return Locomotive.Views.EditableElements.ControlView; } })(); view = new view_class({ model: element }); _this.$("#block-" + block.index + " > fieldset > ol").append(view.render().el); _this._editable_elements_views.push(view); return index += 1; }); }); }; EditAllView.prototype.enable_nav = function() { var _this = this; return this.$('.nav a').click(function(event) { var index, link; event.stopPropagation() & event.preventDefault(); link = $(event.target); index = parseInt(link.prop('href').match(/block-(.+)/)[1]); _this.$('.wrapper ul li.block').hide(); _this.$("#block-" + index).show(); _this._hide_last_separator(); link.parent().find('.on').removeClass('on'); return link.addClass('on'); }); }; EditAllView.prototype._hide_last_separator = function() { var _this = this; return _.each(this.$('fieldset'), function(fieldset) { $(fieldset).find('li.last').removeClass('last'); return $(_.last($(fieldset).find('li.input:visible'))).addClass('last'); }); }; EditAllView.prototype.remove = function() { var _this = this; _.each(this._editable_elements_views, function(view) { return view.remove(); }); this._editable_elements_views.length = 0; return EditAllView.__super__.remove.apply(this, arguments); }; return EditAllView; })(Backbone.View); }).call(this); ;TI"dependency_digest;TI"%055132117c9978976e016b78ef8e8dc8;FI"required_paths;T[I"¨/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.1/app/assets/javascripts/locomotive/views/editable_elements/edit_all_view.js.coffee;FI"dependency_paths;T[{I" path;TI"¨/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/locomotive_cms-2.3.1/app/assets/javascripts/locomotive/views/editable_elements/edit_all_view.js.coffee;FI" mtime;TI"2013-11-11T00:40:29+01:00;TI" digest;TI"%ab6dcff2e3598f0f752775bc595070e8;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F