/*jshint multistr:true */ this.recline = this.recline || {}; this.recline.View = this.recline.View || {}; (function($, my) { "use strict"; my.QueryEditor = Backbone.View.extend({ className: 'recline-query-editor', template: ' \
\ ', events: { 'submit form': 'onFormSubmit' }, initialize: function() { _.bindAll(this, 'render'); this.listenTo(this.model, 'change', this.render); this.render(); }, onFormSubmit: function(e) { e.preventDefault(); var query = this.$el.find('.search-query').val(); this.model.set({q: query}); }, render: function() { var tmplData = I18nMessages('recline', recline.View.translations).injectMustache(this.model.toJSON()); var templated = Mustache.render(this.template, tmplData); this.$el.html(templated); } }); })(jQuery, recline.View);