mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
REFACTOR: Remove Discourse.SvgIconList
and Discourse.SvgSpritePath
We use the session instead. This patch also removes some jQuery usage in favor of regular HTML apis
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import I18n from "I18n";
|
||||
import { h } from "virtual-dom";
|
||||
import attributeHook from "discourse-common/lib/attribute-hook";
|
||||
import { isDevelopment } from "discourse-common/config/environment";
|
||||
import Session from "discourse/models/session";
|
||||
|
||||
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
||||
let _renderers = [];
|
||||
@ -111,14 +111,11 @@ function iconClasses(icon, params) {
|
||||
}
|
||||
|
||||
function warnIfMissing(id) {
|
||||
if (
|
||||
typeof Discourse !== "undefined" &&
|
||||
isDevelopment() &&
|
||||
warnMissingIcons &&
|
||||
Discourse.SvgIconList &&
|
||||
Discourse.SvgIconList.indexOf(id) === -1
|
||||
) {
|
||||
console.warn(`The icon "${id}" is missing from the SVG subset.`); // eslint-disable-line no-console
|
||||
if (warnMissingIcons) {
|
||||
let iconList = Session.currentProp("svgIconList");
|
||||
if (iconList.indexOf(id) === -1) {
|
||||
console.warn(`The icon "${id}" is missing from the SVG subset.`); // eslint-disable-line no-console
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user