framework/ember/app/controllers/application.js

35 lines
791 B
JavaScript
Raw Normal View History

2014-12-20 16:56:46 +10:30
import Ember from 'ember';
export default Ember.Controller.extend({
// The title of the forum.
// TODO: Preload this value in the index.html payload from Laravel config.
2015-01-26 12:06:54 +10:30
forumTitle: 'Flarum Demo Forum',
// The title of the current page. This should be set as appropriate in
// controllers/views.
2014-12-20 16:56:46 +10:30
pageTitle: '',
2015-02-06 10:34:59 +10:30
backButtonTarget: null,
2014-12-20 16:56:46 +10:30
searchQuery: '',
searchActive: false,
2015-02-03 17:02:46 +10:30
alerts: [],
2014-12-20 16:56:46 +10:30
actions: {
search: function(query) {
this.transitionToRoute('index', {queryParams: {searchQuery: query, sort: query ? 'relevance' : 'recent'}});
2015-02-03 17:02:46 +10:30
},
alert: function(message) {
this.get('alerts').pushObject(message);
},
dismissAlert: function(message) {
this.get('alerts').removeObject(message);
},
clearAlerts: function() {
this.get('alerts').clear();
}
2014-12-20 16:56:46 +10:30
}
});