framework/ember/app/views/index/index.js

15 lines
356 B
JavaScript
Raw Normal View History

2014-12-20 14:26:46 +08:00
import Ember from 'ember';
export default Ember.View.extend({
didInsertElement: function() {
this.updateTitle();
},
updateTitle: function() {
2014-12-20 14:26:46 +08:00
var q = this.get('controller.searchQuery');
this.get('controller.controllers.application').set('pageTitle', q ? '"'+q+'"' : '');
}.observes('controller.searchQuery')
2014-12-20 14:26:46 +08:00
});