[DE] fix modified icons using

This commit is contained in:
maxkadushkin
2025-03-19 11:59:21 +03:00
parent 5dc7838d0a
commit 307e732fa2
3 changed files with 18 additions and 6 deletions

View File

@ -82,7 +82,10 @@ define([
text: locale.txtThemeWhite || 'White',
type: 'light',
source: 'static',
icons: './resources/img/v2',
icons: {
basepath: './resources/img/v2',
cls: 'next-mod',
}
},
}
@ -456,9 +459,13 @@ define([
document.body.className = document.body.className.replace(/theme-[\w-]+\s?/gi, '').trim();
document.body.classList.add(theme_id, 'theme-type-' + themes_map[theme_id].type);
if ( !!themes_map[theme_id].icons ) {
const base_url = themes_map[theme_id].icons;
if ( !!themes_map[theme_id].icons && themes_map[theme_id].icons.basepath ) {
const base_url = themes_map[theme_id].icons.basepath;
window.uitheme.apply_icons_from_url(theme_id, base_url);
if ( themes_map[theme_id].icons.cls ) {
document.body.classList.add('theme-icons-cls-' + themes_map[theme_id].icons.cls);
}
}
if ( this.api.asc_setContentDarkMode )
@ -538,8 +545,12 @@ define([
document.body.classList.add('theme-type-' + obj.type);
if (themes_map[theme_id].icons) {
if (!document.querySelector('style#' + theme_id)) {
window.uitheme.apply_icons_from_url(theme_id, themes_map[theme_id].icons);
if (themes_map[theme_id].icons.basepath && !document.querySelector('style#' + theme_id)) {
window.uitheme.apply_icons_from_url(theme_id, themes_map[theme_id].icons.basepath);
}
if ( themes_map[theme_id].icons.cls ) {
document.body.classList.add('theme-icons-cls-' + themes_map[theme_id].icons.cls);
}
}

View File

@ -17,7 +17,7 @@
}
{{/spritesheet}}
{{#sprites}}
{{#parselang name}}.{{name}}{{/parselang}} {
{{#extracls}}{{/extracls}}{{#parselang name}}.{{name}}{{/parselang}} {
@btn-icon-offset: 0;
background-position: @btn-icon-offset {{px.offset_y}};

View File

@ -145,6 +145,7 @@
@import "thumbnails.less";
@import "sprites/iconssmall@1x";
@import "sprites/iconssmall@1x.v2";
@import "sprites/iconsbig@1x";
@import "sprites/iconshuge@1x";
@import "sprites/iconssmall@2x";