diff --git a/app/assets/javascripts/discourse/components/topic-footer-mobile-dropdown.js.es6 b/app/assets/javascripts/discourse/components/topic-footer-mobile-dropdown.js.es6 index 0e2329fb4c4..553b35191ec 100644 --- a/app/assets/javascripts/discourse/components/topic-footer-mobile-dropdown.js.es6 +++ b/app/assets/javascripts/discourse/components/topic-footer-mobile-dropdown.js.es6 @@ -44,6 +44,11 @@ export default Combobox.extend({ const value = this.get('value'); const topic = this.get('topic'); + // In case it's not a valid topic + if (!topic.get('id')) { + return; + } + const refresh = () => { this._createContent(); this.set('value', null); diff --git a/app/assets/javascripts/discourse/helpers/category-badge.js.es6 b/app/assets/javascripts/discourse/helpers/category-badge.js.es6 index 41aad35a597..0d38f38410d 100644 --- a/app/assets/javascripts/discourse/helpers/category-badge.js.es6 +++ b/app/assets/javascripts/discourse/helpers/category-badge.js.es6 @@ -5,6 +5,7 @@ registerUnbound('category-badge', function(cat, options) { return categoryLinkHTML(cat, { hideParent: options.hideParent, allowUncategorized: options.allowUncategorized, + categoryStyle: options.categoryStyle, link: false }); }); diff --git a/app/assets/javascripts/discourse/helpers/category-link.js.es6 b/app/assets/javascripts/discourse/helpers/category-link.js.es6 index fc2524d0330..41683207ee8 100644 --- a/app/assets/javascripts/discourse/helpers/category-link.js.es6 +++ b/app/assets/javascripts/discourse/helpers/category-link.js.es6 @@ -52,7 +52,7 @@ export function categoryBadgeHTML(category, opts) { let classNames = "badge-category clear-badge"; if (restricted) { classNames += " restricted"; } - const categoryStyle = Discourse.SiteSettings.category_style; + const categoryStyle = opts.categoryStyle || Discourse.SiteSettings.category_style; let style = ""; if (categoryStyle === "box") { @@ -93,6 +93,7 @@ export function categoryLinkHTML(category, options) { if (options.link !== undefined) { categoryOptions.link = options.link; } if (options.extraClasses) { categoryOptions.extraClasses = options.extraClasses; } if (options.hideParent) { categoryOptions.hideParent = true; } + if (options.categoryStyle) { categoryOptions.categoryStyle = options.categoryStyle; } } return new Handlebars.SafeString(categoryBadgeHTML(category, categoryOptions)); } diff --git a/app/assets/stylesheets/mobile/buttons.scss b/app/assets/stylesheets/mobile/buttons.scss index 8a30ba692a1..652f8a86014 100644 --- a/app/assets/stylesheets/mobile/buttons.scss +++ b/app/assets/stylesheets/mobile/buttons.scss @@ -2,4 +2,4 @@ h3 .top-title-buttons button { margin-right: 10px; clear: both; margin-top: 5px; -} \ No newline at end of file +}