This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/controllers/navigation_default_controller.js
Régis Hanol 129617b415 Lots of bugfixes
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
2014-01-18 19:27:25 +01:00

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({});