leaflet-theme-control 0.0.3 → 0.0.4
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/package.json +1 -1
- package/src/leaflet-theme-editor.js +11 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "leaflet-theme-control",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "A Leaflet control for switching between visual themes (light, dark, grayscale, custom, etc.) using CSS filters",
|
|
5
5
|
"main": "src/leaflet-theme-control.js",
|
|
6
6
|
"module": "src/leaflet-theme-control.js",
|
|
@@ -332,20 +332,23 @@ export class ThemeEditor {
|
|
|
332
332
|
selectBtn.appendChild(this._el('span', { 'className': 'theme-active-badge', 'aria-hidden': 'true' }, '✓'))
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
-
// Create edit button
|
|
336
|
-
const editBtn = this._el('button', {
|
|
337
|
-
'className': 'theme-edit-btn',
|
|
338
|
-
'data-theme': themeKey,
|
|
339
|
-
'aria-label': `${this._getLabel('customizeTheme')}: ${themeLabel}`,
|
|
340
|
-
}, '⚙️')
|
|
341
|
-
|
|
342
335
|
// Create row container
|
|
343
336
|
const row = this._el('div', {
|
|
344
337
|
'className': `theme-row ${isActive ? 'active' : ''}`,
|
|
345
338
|
'data-theme': themeKey,
|
|
346
339
|
})
|
|
347
340
|
row.appendChild(selectBtn)
|
|
348
|
-
|
|
341
|
+
|
|
342
|
+
// Only show edit button for the active theme
|
|
343
|
+
// User needs to see the theme to edit it meaningfully
|
|
344
|
+
if (isActive) {
|
|
345
|
+
const editBtn = this._el('button', {
|
|
346
|
+
'className': 'theme-edit-btn',
|
|
347
|
+
'data-theme': themeKey,
|
|
348
|
+
'aria-label': `${this._getLabel('customizeTheme')}: ${themeLabel}`,
|
|
349
|
+
}, '⚙️')
|
|
350
|
+
row.appendChild(editBtn)
|
|
351
|
+
}
|
|
349
352
|
|
|
350
353
|
return row
|
|
351
354
|
}
|