o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1381142257.822294: @value"{I" class:EFI"ProcessedAsset;FI"logical_path;FI"2locomotive/views/shared/fields/select_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/fields/select_view.js.coffee;TI"content_type;FI"application/javascript;FI" mtime;FI"2013-10-07T10:55:40+02:00;FI" length;FiI" digest;F"%52420ce04bd92fb66042c412c41a6d46I" source;FI"(function() { var _base, _base1, _ref, __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); _ref = SelectView.__super__.constructor.apply(this, arguments); return _ref; } 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() { var _this = this; return this.dialog = $(this.el).dialog({ autoOpen: false, modal: true, zIndex: window.application_view.unique_dialog_zindex(), width: 770, create: 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); }, open: function(event, ui, extra) { return $(_this.el).dialog('overlayEl').bind('click', function() { return _this.close(); }); } }); }; 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;F"%ccc6b8a4be560c43ead7539a42527767I"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/fields/select_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/fields/select_view.js.coffee;TI" mtime;FI"2013-10-07T10:55:40+02:00;FI" digest;F"%cf363717fd12ce900f94fa4fbf647432I" _version;F"%ffd318ca8b794f42f5029101c2cf5d91