mirror of
https://github.com/elder-plinius/P4RS3LT0NGV3.git
synced 2026-03-09 20:55:40 +00:00
- Implement tool registry system with individual tool modules - Reorganize transformers into categorized source modules - Remove emojiLibrary.js, consolidate into EmojiUtils and emojiData - Fix mobile close button and tooltip functionality - Add build system for transforms and emoji data - Migrate from Python backend to pure JavaScript - Add comprehensive documentation and testing - Improve code organization and maintainability - Ignore generated files (transforms-bundle.js, emojiData.js)
30 lines
819 B
JavaScript
30 lines
819 B
JavaScript
window.FocusUtils = {
|
|
focusWithoutScroll(element) {
|
|
if (!element) return;
|
|
|
|
try {
|
|
const scrollX = window.pageXOffset || window.scrollX || 0;
|
|
const scrollY = window.pageYOffset || window.scrollY || 0;
|
|
element.focus();
|
|
window.scrollTo(scrollX, scrollY);
|
|
} catch (e) {
|
|
try {
|
|
element.focus();
|
|
} catch (err) {
|
|
console.warn('Failed to focus element:', err);
|
|
}
|
|
}
|
|
},
|
|
|
|
clearFocusAndSelection() {
|
|
if (document.activeElement && document.activeElement.blur) {
|
|
document.activeElement.blur();
|
|
}
|
|
if (window.getSelection) {
|
|
window.getSelection().removeAllRanges();
|
|
}
|
|
document.body.focus();
|
|
}
|
|
};
|
|
|