o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1396340896.734627: @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/bundler/gems/engine-89566d497862/app/assets/javascripts/locomotive/views/editable_elements/edit_all_view.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;TI"2014-04-01T10:04:05+02:00;TI" length;Ti8I" digest;TI"%51ba738f30284c562a9d2c364f947cfc;FI" source;TI"8(function() { var _base, __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() { return EditAllView.__super__.constructor.apply(this, arguments); } 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() { return _.each(this._editable_elements_views, (function(_this) { return function(view) { return view.after_render(); }; })(this)); }; EditAllView.prototype.refresh = function() { return _.each(this._editable_elements_views, (function(_this) { return function(view) { view.model = _this.collection.get(view.model.get('id')); return view.refresh(); }; })(this)); }; EditAllView.prototype.unbind_model = function() { return _.each(this._editable_elements_views, (function(_this) { return function(view) { return Backbone.ModelBinding.unbind(view); }; })(this)); }; EditAllView.prototype.render_elements = function() { var index; index = 0; return _.each(this.blocks, (function(_this) { return 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; }); }; })(this)); }; EditAllView.prototype.enable_nav = function() { return this.$('.nav a').click((function(_this) { return 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'); }; })(this)); }; EditAllView.prototype._hide_last_separator = function() { return _.each(this.$('fieldset'), (function(_this) { return function(fieldset) { $(fieldset).find('li.last').removeClass('last'); return $(_.last($(fieldset).find('li.input:visible'))).addClass('last'); }; })(this)); }; EditAllView.prototype.remove = function() { _.each(this._editable_elements_views, (function(_this) { return function(view) { return view.remove(); }; })(this)); this._editable_elements_views.length = 0; return EditAllView.__super__.remove.apply(this, arguments); }; return EditAllView; })(Backbone.View); }).call(this); ;TI"dependency_digest;TI"%537404c8b205b2782d50a4a8378d99d6;FI"required_paths;T[I"¯/Users/didier/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/engine-89566d497862/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/bundler/gems/engine-89566d497862/app/assets/javascripts/locomotive/views/editable_elements/edit_all_view.js.coffee;FI" mtime;TI"2014-04-01T10:04:05+02:00;TI" digest;TI"%ab6dcff2e3598f0f752775bc595070e8;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F