o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1396022704.846018: @value"A{I" class:ETI"ProcessedAsset;FI"logical_path;TI"0locomotive/views/shared/_search_bar_view.js;FI" pathname;TI"{/Users/didier/Documents/LocomotiveCMS/gems/search/app/assets/javascripts/locomotive/views/shared/_search_bar_view.js.coffee;FI"content_type;TI"application/javascript;TI" mtime;TI"2014-03-28T13:16:49+01:00;TI" length;Tiu I" digest;TI"%5041d68adfcf331513b0ea52542c56ef;FI" source;TI"u (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).Shared || (_base.Shared = {}); Locomotive.Views.Shared.SearchBarView = (function(_super) { __extends(SearchBarView, _super); function SearchBarView() { return SearchBarView.__super__.constructor.apply(this, arguments); } SearchBarView.prototype.el = '#search-bar'; SearchBarView.prototype.initialize = function() { return _.bindAll(this, 'search'); }; SearchBarView.prototype.render = function() { this.enable_type_head(); return this; }; SearchBarView.prototype.enable_type_head = function() { var $input; $input = this.$('input[type=text]'); this.typeahead = $input.typeahead({ hint: true, highlight: true, minLength: 2 }, { source: this.indexer({ per_page: 10 }), displayKey: 'title', templates: { empty: ich.no_search_entries_found, suggestion: ich.search_entry } }).on('typeahead:closed', (function(_this) { return function(event, datum) { _this.$('.twitter-typeahead').removeClass('on').removeClass('opened'); return $('a')[0].focus(); }; })(this)).on('typeahead:selected', (function(_this) { return function(event, suggestion, datum) { event.stopPropagation() & event.preventDefault(); return window.location.href = suggestion.path; }; })(this)).data('ttTypeahead').dropdown.onSync('datasetRendered', (function(_this) { return function() { var dropdown; dropdown = $input.data('ttTypeahead').dropdown; if (dropdown.isEmpty) { return _this.$('.twitter-typeahead').removeClass('opened'); } else { return _this.$('.twitter-typeahead').addClass('opened'); } }; })(this)); return this.$('.twitter-typeahead').on('click', function() { return $(this).addClass('on').removeClass('opened'); }); }; SearchBarView.prototype.indexer = function(params) { return (function(_this) { return function(query, cb) { return _this.search(query, function(success, content) { if (success) { return cb(content); } }, params); }; })(this); }; SearchBarView.prototype.search = function(query, callback, params) { return $.ajax({ url: this.$('form').attr('action'), data: _.extend(params || {}, { query: query }), success: (function(_this) { return function(data, statusText, xhr) { return callback(true, data.results); }; })(this), dataType: 'json' }); }; return SearchBarView; })(Backbone.View); }).call(this); ;TI"dependency_digest;TI"%1d56e770734d33554e3c4a33d374964b;FI"required_paths;T[I"{/Users/didier/Documents/LocomotiveCMS/gems/search/app/assets/javascripts/locomotive/views/shared/_search_bar_view.js.coffee;FI"dependency_paths;T[{I" path;TI"{/Users/didier/Documents/LocomotiveCMS/gems/search/app/assets/javascripts/locomotive/views/shared/_search_bar_view.js.coffee;FI" mtime;TI"2014-03-28T13:16:49+01:00;TI" digest;TI"%fe05cdff0fc5ec60861583416deb2b20;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F