BUGFIX: navigation bar should always activate the right tab (even when diging into a top period) BUGFIX: /top pages titles BUGFIX: no "edit category" button on /top page after visiting a category BUGFIX: properly hide category columns when there is no children category (on both filter + top pages) BUGFIX: promises not caught when scrolling down a topic list to load more of them BUGFIX: CSS on category dropdowns Updated `top_menu` i18n with available filters
41 lines
1.2 KiB
JavaScript
41 lines
1.2 KiB
JavaScript
/**
|
|
Handles the controller for the default navigation within discovery.
|
|
|
|
@class NavigationDefaultController
|
|
@extends Discourse.Controller
|
|
@namespace Discourse
|
|
@module Discourse
|
|
**/
|
|
Discourse.NavigationDefaultController = Discourse.Controller.extend({
|
|
needs: ['composer', 'discoveryTopics'],
|
|
|
|
actions: {
|
|
createTopic: function() {
|
|
var topicsController = this.get('controllers.discoveryTopics');
|
|
this.get('controllers.composer').open({
|
|
categoryId: this.get('category.id'),
|
|
action: Discourse.Composer.CREATE_TOPIC,
|
|
draft: topicsController.get('draft'),
|
|
draftKey: topicsController.get('draft_key'),
|
|
draftSequence: topicsController.get('draft_sequence')
|
|
});
|
|
}
|
|
},
|
|
|
|
categories: function() {
|
|
return Discourse.Category.list();
|
|
}.property(),
|
|
|
|
navItems: function() {
|
|
return Discourse.NavItem.buildList();
|
|
}.property()
|
|
});
|
|
|
|
Discourse.NavigationCategoryController = Discourse.NavigationDefaultController.extend({
|
|
navItems: function() {
|
|
return Discourse.NavItem.buildList(this.get('category'), { noSubcategories: this.get('noSubcategories') });
|
|
}.property('category', 'noSubcategories')
|
|
});
|
|
|
|
Discourse.NavigationCategoriesController = Discourse.NavigationDefaultController.extend({});
|