o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1416672645.95779: @value"î{I" class:ETI"ProcessedAsset;FI"logical_path;TI"9locomotive/views/shared/fields/_relationship_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/_relationship_view.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;TI"2014-11-22T16:47:36+01:00;TI" length;Tiž I" digest;TI"%a8e45b937409c3cc03b92a5327ecf35c;FI" source;TI"ž (function() { var _base, _base1, __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.RelationshipView = (function(_super) { __extends(RelationshipView, _super); function RelationshipView() { return RelationshipView.__super__.constructor.apply(this, arguments); } RelationshipView.prototype.enable_select2 = function(element, options) { options || (options = {}); options.init_selection_fn || (options.init_selection_fn = function(element, callback) { return null; }); return element.select2({ width: '50%', minimumInputLength: 1, quietMillis: 100, allowClear: true, placeholder: ' ', initSelection: options.init_selection_fn, ajax: { url: options.url, data: function(term, page) { return { q: term, page: page }; }, results: (function(_this) { return function(data, page) { return { results: _this.build_results(data, options.groupBy), more: data.length === options.perPage }; }; })(this) } }); }; RelationshipView.prototype.build_results = function(raw_data, group_by) { return _.tap([], (function(_this) { return function(list) { return _.each(raw_data, function(data) { var group, group_name; if ((_this.collection == null) || (_this.collection.get(data._id) == null)) { data.text = data._label; if (group_by != null) { group_name = _.result(data, group_by); group = _.find(list, function(_group) { return _group.text === group_name; }); if (group == null) { group = { text: group_name, children: [] }; list.push(group); } return group.children.push(data); } else { return list.push(data); } } }); }; })(this)); }; return RelationshipView; })(Backbone.View); }).call(this); ;TI"dependency_digest;TI"%3cd188bc84567a48328052b246870051;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/_relationship_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/_relationship_view.js.coffee;FI" mtime;TI"2014-11-22T16:47:36+01:00;TI" digest;TI"%e1f413ce9ba3c0c0b7949a1ddc65edef;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F