From dd7361441d0ee88b686544e89f95113084f57e09 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 1 May 2024 14:43:35 +0100 Subject: [PATCH] chore: Clarify usage of window fields in UIContextMenu.js /puter/src/UI/UIContextMenu.js 23:21 error 'global_element_id' is not defined no-undef 117:57 error 'taskbar_height' is not defined no-undef 118:52 error 'taskbar_height' is not defined no-undef 260:17 error 'make_taskbar_sortable' is not defined no-undef --- src/UI/UIContextMenu.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/UI/UIContextMenu.js b/src/UI/UIContextMenu.js index 9f5f65d3..367bc33c 100644 --- a/src/UI/UIContextMenu.js +++ b/src/UI/UIContextMenu.js @@ -20,7 +20,7 @@ function UIContextMenu(options){ $('.window-active .window-app-iframe').css('pointer-events', 'none'); - const menu_id = global_element_id++; + const menu_id = window.global_element_id++; let h = ''; h += `
(window.innerHeight - taskbar_height - 10)) - y_pos = window.innerHeight - menu_height - taskbar_height - 10; + if( (start_y + menu_height) > (window.innerHeight - window.taskbar_height - 10)) + y_pos = window.innerHeight - menu_height - window.taskbar_height - 10; else y_pos = start_y; @@ -257,7 +257,7 @@ function UIContextMenu(options){ $(options.parent_element).css('overflow', 'scroll'); $(options.parent_element).removeClass('has-open-contextmenu'); if($(options.parent_element).hasClass('taskbar-item')){ - make_taskbar_sortable() + window.make_taskbar_sortable() } } })