o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1416672646.619518: @value"{I" class:ETI"ProcessedAsset;FI"logical_path;TI"2locomotive/views/shared/fields/select_view.js;FI" pathname;TI"/Users/didier/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/locomotive_cms-2.5.5/app/assets/javascripts/locomotive/views/shared/fields/select_view.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;TI"2014-11-22T16:47:36+01:00;TI" length;TitI" digest;TI"%2ce507a779037311fcbd3140f5290c06;FI" source;TI"t(function() { var _base, _base1, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __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 = {}); (_base1 = Locomotive.Views.Shared).Fields || (_base1.Fields = {}); Locomotive.Views.Shared.Fields.SelectView = (function(_super) { __extends(SelectView, _super); function SelectView() { this.on_save = __bind(this.on_save, this); return SelectView.__super__.constructor.apply(this, arguments); } SelectView.prototype.el = '#edit-select-option-entries'; SelectView.prototype.select_options_view = null; SelectView.prototype.initialize = function() { _.bindAll(this, 'save', 'on_save'); this.create_dialog(); return SelectView.__super__.initialize.call(this); }; SelectView.prototype.render = function() { this.render_select_options_view(); return this.open(); }; SelectView.prototype.render_for = function(name, callback) { this.name = name; this.on_save_callback = callback; this.custom_field = this.model.find_entries_custom_field(this.name); return this.render(); }; SelectView.prototype.create_dialog = function() { return this.dialog = $(this.el).dialog({ autoOpen: false, modal: true, zIndex: window.application_view.unique_dialog_zindex(), width: 770, create: (function(_this) { return function(event, ui) { $(_this.el).prev().find('.ui-dialog-title').html(_this.$('h2').html()); _this.$('h2').remove(); _this.$form = _this.$('.placeholder').formSubmitNotification(); _this.$buttons_pane = _this.$('.dialog-actions').appendTo($(_this.el).parent()).addClass('ui-dialog-buttonpane ui-widget-content ui-helper-clearfix'); _this.$buttons_pane.find('#close-link').click(function(event) { return _this.close(event); }); return _this.$buttons_pane.find('input[type=submit]').click(_this.save); }; })(this), open: (function(_this) { return function(event, ui, extra) { return $(_this.el).dialog('overlayEl').bind('click', function() { return _this.close(); }); }; })(this) }); }; SelectView.prototype.save = function(event) { event.stopPropagation() & event.preventDefault(); this.$form.trigger('ajax:beforeSend'); $.rails.disableFormElements(this.$buttons_pane); return this.model.save({}, { success: this.on_save, error: this.on_save }); }; SelectView.prototype.on_save = function(model, response) { $.rails.enableFormElements(this.$buttons_pane); model._normalize(); this.custom_field = model.find_entries_custom_field(this.custom_field.get('name')); this.$form.trigger('ajax:complete'); if (this.on_save_callback != null) { this.on_save_callback(this.custom_field.get('select_options').sortBy(function(option) { return option.get('position'); })); } return this.close(); }; SelectView.prototype.render_select_options_view = function() { if (this.select_options_view != null) { this.select_options_view.remove(); } this.select_options_view = new Locomotive.Views.ContentTypes.SelectOptionsView({ model: this.custom_field, collection: this.custom_field.get('select_options') }); return this.$('.placeholder').append(this.select_options_view.render().el); }; SelectView.prototype.open = function() { return $(this.el).dialog('open'); }; SelectView.prototype.close = function(event) { if (event != null) { event.stopPropagation() & event.preventDefault(); } $(this.el).dialog('overlayEl').unbind('click'); return $(this.el).dialog('close'); }; SelectView.prototype.center = function() { return $(this.el).dialog('option', 'position', 'center'); }; return SelectView; })(Backbone.View); }).call(this); ;TI"dependency_digest;TI"%77068ff309b2c1e8eecafd7d9df48361;FI"required_paths;T[I"/Users/didier/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/locomotive_cms-2.5.5/app/assets/javascripts/locomotive/views/shared/fields/select_view.js.coffee;FI"dependency_paths;T[{I" path;TI"/Users/didier/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/locomotive_cms-2.5.5/app/assets/javascripts/locomotive/views/shared/fields/select_view.js.coffee;FI" mtime;TI"2014-11-22T16:47:36+01:00;TI" digest;TI"%cf363717fd12ce900f94fa4fbf647432;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F