aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/browser-gates.js
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-13 17:50:54 -0500
committerCraig Jennings <c@cjennings.net>2026-06-13 17:50:54 -0500
commit060e08a90daef6dbd36464d7e21c0a5a3094d8d4 (patch)
tree99bb135e67cd91a2df266ab40ab08495bdad1d6c /scripts/theme-studio/browser-gates.js
parent6594c6234a63e354d47a497d60764dc367b05d70 (diff)
downloaddotemacs-060e08a90daef6dbd36464d7e21c0a5a3094d8d4.tar.gz
dotemacs-060e08a90daef6dbd36464d7e21c0a5a3094d8d4.zip
Refine theme studio tile name editing
Diffstat (limited to 'scripts/theme-studio/browser-gates.js')
-rw-r--r--scripts/theme-studio/browser-gates.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/theme-studio/browser-gates.js b/scripts/theme-studio/browser-gates.js
index cc1b3aaa..77314217 100644
--- a/scripts/theme-studio/browser-gates.js
+++ b/scripts/theme-studio/browser-gates.js
@@ -323,6 +323,15 @@ if(location.hash==='#columntest'||location.hash==='#familytest'){let ok=true;con
A(!document.querySelector('#pals .fstrip[data-column="ground"] .cdel'),'ground column has no delete button');
const redChip=[...document.querySelectorAll('#pals .pchip')].find(c=>c.querySelector('.nm')&&c.querySelector('.nm').value==='red');
A(!!redChip&&!!redChip.querySelector('.rm')&&!!redChip.querySelector('.nm'),'a column chip keeps remove + rename controls');
+ if(redChip){
+ const redName=redChip.querySelector('.nm');selectedIdx=null;redName.click();
+ A(selectedIdx!==null&&PALETTE[selectedIdx][1]==='red','single-clicking a tile name selects the whole tile');
+ A(redName.readOnly===true&&!redName.classList.contains('editing'),'single-clicking a tile name does not enter name edit mode');
+ redName.dispatchEvent(new MouseEvent('dblclick',{bubbles:true,cancelable:true}));
+ A(redName.readOnly===false&&redName.classList.contains('editing'),'double-clicking a tile name enters edit mode');
+ A(redName.selectionStart===0&&redName.selectionEnd===0,'double-clicking places the cursor at the beginning of the name');
+ redName.blur();
+ }
const redColumn=redChip&&redChip.closest('.fstrip').dataset.column;
const ri=PALETTE.findIndex(p=>p[1]==='red');PALETTE[ri][1]='zztop-absurd';renderPalette();
const renamed=[...document.querySelectorAll('#pals .pchip')].find(c=>c.querySelector('.nm')&&c.querySelector('.nm').value==='zztop-absurd');