Zoom and Pan: move helpers into its namespace to avoid littering global scope

This commit is contained in:
Aarni Koskela 2023-06-05 10:19:06 +03:00
parent 9781f31f74
commit 8fd20bd4c3

View File

@ -1,3 +1,4 @@
onUiLoaded(async() => {
// Helper functions // Helper functions
// Get active tab // Get active tab
function getActiveTab(elements, all = false) { function getActiveTab(elements, all = false) {
@ -79,7 +80,6 @@ function createHotkeyConfig(defaultHotkeysConfig, hotkeysConfigOpts) {
* to avoid breaking the canvas. Additionally, the function adjusts the mask to work correctly on * to avoid breaking the canvas. Additionally, the function adjusts the mask to work correctly on
* very long images. * very long images.
*/ */
function restoreImgRedMask(elements, elementIDs) { function restoreImgRedMask(elements, elementIDs) {
const mainTabId = getTabId(elements, elementIDs); const mainTabId = getTabId(elements, elementIDs);
@ -114,8 +114,6 @@ function restoreImgRedMask(elements, elementIDs) {
}, 400); }, 400);
} }
// Main
onUiLoaded(async() => {
const hotkeysConfigOpts = await waitForOpts(); const hotkeysConfigOpts = await waitForOpts();
// Default config // Default config