mirror of
https://github.com/flarum/framework.git
synced 2024-12-11 21:43:38 +08:00
74e80ea2df
- Write CSS for everything, update templates. - Refactor discussion view. Stream is split into two components (content and scrubber) which have their own responsibilities. - Extract pane functionality into a mixin. - Implement global “back button” system. You give a “paneable” target to the application controller, the back button will modulate its pane-related properties as necessary, and call an action when the button is clicked. - Extract welcome-hero into its own component. - Lots of other general improvements/refactoring. The code is quite well-commented so take a look!
36 lines
969 B
JavaScript
36 lines
969 B
JavaScript
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.
|
|
forumTitle: 'Ninetech Support Forum',
|
|
|
|
// The title of the current page. This should be set as appropriate in
|
|
// controllers/views.
|
|
pageTitle: '',
|
|
|
|
// When either the forum title or the page title changes, we want to
|
|
// refresh the document's title.
|
|
updateTitle: function() {
|
|
var parts = [this.get('forumTitle')];
|
|
var pageTitle = this.get('pageTitle');
|
|
if (pageTitle) {
|
|
parts.unshift(pageTitle);
|
|
}
|
|
document.title = parts.join(' - ');
|
|
}.observes('pageTitle', 'forumTitle'),
|
|
|
|
// Whether or not a pane is currently pinned to the side of the interface.
|
|
panePinned: false,
|
|
|
|
searchQuery: '',
|
|
searchActive: false,
|
|
|
|
actions: {
|
|
search: function(query) {
|
|
this.transitionToRoute('index', {queryParams: {searchQuery: query, sort: query ? 'relevance' : 'recent'}});
|
|
}
|
|
}
|
|
});
|