diff options
| author | historia <[not public]> | 2026-07-01 04:53:56 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-07-01 04:53:56 -0400 |
| commit | bf7c27c2cbf3eb56a0a4c5141e39b152c51614b5 (patch) | |
| tree | 5383c325fafeb34c01ea737a7070402f040fc5af /internal/admin/static/colorpicker.js | |
| parent | fbe5090ac3325ff8ea6989cdf4515c7f077c975b (diff) | |
| download | thehouseoficarus-bf7c27c2cbf3eb56a0a4c5141e39b152c51614b5.tar.gz | |
feat: admin gui map, item, and objects mostly complete
Diffstat (limited to 'internal/admin/static/colorpicker.js')
| -rw-r--r-- | internal/admin/static/colorpicker.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/admin/static/colorpicker.js b/internal/admin/static/colorpicker.js index 9431e83..bba438e 100644 --- a/internal/admin/static/colorpicker.js +++ b/internal/admin/static/colorpicker.js @@ -62,6 +62,7 @@ window.cssToXtermIdx = function(css) { (function() { var pickerEl = null, boundInput = null, boundSwatch = null; + window._colorPickerActive = false; function ensurePicker() { if (pickerEl) return; @@ -114,6 +115,7 @@ window.cssToXtermIdx = function(css) { idx = parseInt(raw, 16) || 0; } var hex = xtermIdxToHex(idx); + window._colorPickerActive = true; inputEl.value = hex; if (swatchEl) swatchEl.style.background = xtermToCss(idx); @@ -153,7 +155,12 @@ window.cssToXtermIdx = function(css) { window.hideColorPicker = hidePicker; function hidePicker() { if (pickerEl) pickerEl.style.display = 'none'; + var input = boundInput; boundInput = null; boundSwatch = null; + window._colorPickerActive = false; + if (input && input.isConnected) { + input.dispatchEvent(new Event('input', {bubbles:true})); + } } document.addEventListener('click', function(e) { |
