Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Normal
js/xf/core.js[code]const newIcon = XF.createElementFromString( XF.Icon.getIcon('default', icon))menuIcon.replaceWith(newIcon)[/code]This code essentialy prevents using style variation switcher icons in a non-default weight as the runtime-generated icon HTML becomes invalid if a diffrent weight (fas, etc.) is specified.It seems unnecessarily limiting and inconsistent with other parts of the software (like forum type icons) where it is possible to use non-default weights.The attached patch fixes this by introducing a new method XF.Icon.getIconParamsFromClassString to extract the required info (variant, name, classes) from a given class string and uses this to display the correct icon while also adding support for duotone icons.
js/xf/core.js
[code]
const newIcon = XF.createElementFromString(
XF.Icon.getIcon('default', icon)
)
menuIcon.replaceWith(newIcon)
[/code]
This code essentialy prevents using style variation switcher icons in a non-default weight as the runtime-generated icon HTML becomes invalid if a diffrent weight (fas, etc.) is specified.
It seems unnecessarily limiting and inconsistent with other parts of the software (like forum type icons) where it is possible to use non-default weights.
The attached patch fixes this by introducing a new method XF.Icon.getIconParamsFromClassString to extract the required info (variant, name, classes) from a given class string and uses this to display the correct icon while also adding support for duotone icons.
XF.Icon.getIconParamsFromClassString
We use essential cookies to make this site work, and optional cookies to enhance your experience.
See further information and configure your preferences