@kupola/kupola 1.6.8 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/js/theme.js CHANGED
@@ -91,16 +91,19 @@ function initTheme() {
91
91
  if (toggleBtn) {
92
92
  const iconEl = toggleBtn.querySelector('.theme-icon');
93
93
  if (iconEl && iconEl.src) {
94
- const iconPath = iconEl.src.substring(0, iconEl.src.lastIndexOf('/') + 1);
95
- const basePath = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/') + 1);
96
- const relativeIconsPath = iconPath.replace(window.location.origin + basePath, '');
97
- if (relativeIconsPath !== iconPath) {
98
- setConfig({
99
- paths: {
100
- icons: relativeIconsPath,
101
- base: basePath
102
- }
103
- });
94
+ const currentIconsPath = getIconsPath();
95
+ if (currentIconsPath === '/icons/') {
96
+ const iconPath = iconEl.src.substring(0, iconEl.src.lastIndexOf('/') + 1);
97
+ const basePath = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/') + 1);
98
+ const relativeIconsPath = iconPath.replace(window.location.origin + basePath, '');
99
+ if (relativeIconsPath !== iconPath) {
100
+ setConfig({
101
+ paths: {
102
+ icons: relativeIconsPath,
103
+ base: basePath
104
+ }
105
+ });
106
+ }
104
107
  }
105
108
  }
106
109
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kupola/kupola",
3
- "version": "1.6.8",
3
+ "version": "1.7.0",
4
4
  "description": "A lightweight UI toolkit for any web project. No heavy frontend frameworks required.",
5
5
  "main": "dist/kupola.cjs.js",
6
6
  "module": "dist/kupola.esm.js",