mirror of
https://github.com/flarum/framework.git
synced 2024-12-13 15:13:42 +08:00
20 lines
526 B
JavaScript
20 lines
526 B
JavaScript
import Ember from 'ember';
|
|
|
|
export default Ember.View.extend({
|
|
|
|
didInsertElement: function() {
|
|
this.updateTitle();
|
|
$(window).scrollTop(this.get('controller.scrollTop'));
|
|
},
|
|
|
|
willDestroyElement: function() {
|
|
this.set('controller.scrollTop', $(window).scrollTop());
|
|
},
|
|
|
|
updateTitle: function() {
|
|
var q = this.get('controller.searchQuery');
|
|
this.get('controller.controllers.application').set('pageTitle', q ? '"'+q+'"' : '');
|
|
}.observes('controller.searchQuery')
|
|
|
|
});
|