From f1a9e52d7e2c1c509027ee38c13eaf68d4a5105a Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 10 Feb 2014 14:08:16 -0500 Subject: [PATCH] When creating/editing a category the parent shoudl be none. --- .../discourse/templates/modal/edit_category.js.handlebars | 2 +- .../javascripts/discourse/views/category_chooser_view.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/templates/modal/edit_category.js.handlebars b/app/assets/javascripts/discourse/templates/modal/edit_category.js.handlebars index df18f0de9f8..5fe53e82517 100644 --- a/app/assets/javascripts/discourse/templates/modal/edit_category.js.handlebars +++ b/app/assets/javascripts/discourse/templates/modal/edit_category.js.handlebars @@ -29,7 +29,7 @@ {{/each}} {{else}} - {{categoryChooser valueAttribute="id" value=parent_category_id categories=parentCategories}} + {{categoryChooser valueAttribute="id" value=parent_category_id categories=parentCategories rootNone=true}} {{/if}} diff --git a/app/assets/javascripts/discourse/views/category_chooser_view.js b/app/assets/javascripts/discourse/views/category_chooser_view.js index cb6712c8bcb..41e54a95291 100644 --- a/app/assets/javascripts/discourse/views/category_chooser_view.js +++ b/app/assets/javascripts/discourse/views/category_chooser_view.js @@ -26,7 +26,11 @@ Discourse.CategoryChooserView = Discourse.ComboboxView.extend({ none: function() { if (Discourse.User.currentProp('staff') || Discourse.SiteSettings.allow_uncategorized_topics) { - return Discourse.Category.list().findBy('id', Discourse.Site.currentProp('uncategorized_category_id')); + if (this.get('rootNone')) { + return "category.none"; + } else { + return Discourse.Category.list().findBy('id', Discourse.Site.currentProp('uncategorized_category_id')); + } } else { return 'category.choose'; }