mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-09 23:04:45 +02:00
⚡ Improves the process for auto checking if Font-Awesome needed
This commit is contained in:
parent
75fd1347ac
commit
fe9f9f664a
@ -160,13 +160,17 @@ export default {
|
|||||||
},
|
},
|
||||||
/* Checks if any of the icons are Font Awesome glyphs */
|
/* Checks if any of the icons are Font Awesome glyphs */
|
||||||
checkIfFontAwesomeNeeded() {
|
checkIfFontAwesomeNeeded() {
|
||||||
let isFound = false;
|
let isNeeded = false;
|
||||||
|
if (!this.sections) return false;
|
||||||
this.sections.forEach((section) => {
|
this.sections.forEach((section) => {
|
||||||
|
if (section.icon && section.icon.includes('fa-')) isNeeded = true;
|
||||||
section.items.forEach((item) => {
|
section.items.forEach((item) => {
|
||||||
if (item.icon && item.icon.includes('fa-')) isFound = true;
|
if (item.icon && item.icon.includes('fa-')) isNeeded = true;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return isFound;
|
const currentTheme = localStorage[localStorageKeys.THEME]; // Some themes require FA
|
||||||
|
if (['material', 'material-dark'].includes(currentTheme)) isNeeded = true;
|
||||||
|
return isNeeded;
|
||||||
},
|
},
|
||||||
/* Injects font-awesome's script tag, only if needed */
|
/* Injects font-awesome's script tag, only if needed */
|
||||||
initiateFontAwesome() {
|
initiateFontAwesome() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user