From e378f4dcc7621f159d1cb0130f9d27ad8e505c53 Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 16 Dec 2021 02:33:41 +0800 Subject: [PATCH] UX: allow component to change lock icons in category boxes (#9) --- javascripts/discourse/initializers/category-icons.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/javascripts/discourse/initializers/category-icons.js b/javascripts/discourse/initializers/category-icons.js index a5d87db..f9a771f 100644 --- a/javascripts/discourse/initializers/category-icons.js +++ b/javascripts/discourse/initializers/category-icons.js @@ -6,6 +6,8 @@ import { isRTL } from "discourse/lib/text-direction"; import { h } from "virtual-dom"; import getURL from "discourse-common/lib/get-url"; import categoryTitleLink from "discourse/components/category-title-link"; +import categoriesBoxes from "discourse/components/categories-boxes"; +import categoriesBoxesWithTopics from "discourse/components/categories-boxes-with-topics"; import I18n from "I18n"; import { get } from "@ember/object"; import { escapeExpression } from "discourse/lib/utilities"; @@ -22,6 +24,14 @@ export default { lockIcon: lockIcon, }); + categoriesBoxes.reopen({ + lockIcon: lockIcon, + }); + + categoriesBoxesWithTopics.reopen({ + lockIcon: lockIcon, + }); + function categoryStripe(color, classes) { var style = color ? "style='background-color: #" + color + ";'" : ""; return "";