2014-12-20 14:26:46 +08:00
|
|
|
import Ember from 'ember';
|
|
|
|
|
|
|
|
export default Ember.View.extend({
|
2015-01-16 14:56:10 +08:00
|
|
|
|
|
|
|
didInsertElement: function() {
|
|
|
|
this.updateTitle();
|
2015-02-06 08:06:30 +08:00
|
|
|
$(window).scrollTop(this.get('controller.scrollTop'));
|
|
|
|
},
|
|
|
|
|
|
|
|
willDestroyElement: function() {
|
|
|
|
this.set('controller.scrollTop', $(window).scrollTop());
|
2015-01-16 14:56:10 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
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+'"' : '');
|
2015-01-16 14:56:10 +08:00
|
|
|
}.observes('controller.searchQuery')
|
2014-12-20 14:26:46 +08:00
|
|
|
|
|
|
|
});
|