Убраны горячие клавиши r, к, m и добавлена блокировка горячих клавиш при вводе в поля

This commit is contained in:
Сергей Антропов 2025-08-17 18:08:22 +03:00
parent 59e0810750
commit 3126ff4eb6

View File

@ -4366,8 +4366,21 @@ if (els.lvlErr) {
};
}
// Hotkeys: [ ] — tabs, M — multi, R — refresh
// Hotkeys: [ ] — navigation between containers
window.addEventListener('keydown', async (e)=>{
// Проверяем, не находится ли фокус в поле ввода
const activeElement = document.activeElement;
const isInputActive = activeElement && (
activeElement.tagName === 'INPUT' ||
activeElement.tagName === 'TEXTAREA' ||
activeElement.contentEditable === 'true'
);
// Если фокус в поле ввода, не обрабатываем горячие клавиши
if (isInputActive) {
return;
}
if (e.key==='[' || (e.ctrlKey && e.key==='ArrowLeft')){
e.preventDefault();
const idx = state.services.findIndex(s=> s.id===state.current?.id);
@ -4378,15 +4391,8 @@ window.addEventListener('keydown', async (e)=>{
const idx = state.services.findIndex(s=> s.id===state.current?.id);
if (idx>=0 && idx<state.services.length-1) await switchToSingle(state.services[idx+1]);
}
if (e.key.toLowerCase()==='m'){
const list = state.services.map(s=> `${s.id}:${s.service}`).join(', ');
const ans = prompt('IDs через запятую:\n'+list);
if (ans) openMulti(ans.split(',').map(x=>x.trim()).filter(Boolean));
}
if (e.key.toLowerCase()==='r' || e.key.toLowerCase()==='к'){
e.preventDefault();
refreshLogsAndCounters();
}
});
// Инициализация