From 0606fe99cd65d98b8747a385225bd1792235baab Mon Sep 17 00:00:00 2001 From: ellvix Date: Sat, 25 Jan 2025 19:17:16 -0700 Subject: [PATCH] fix: updated ui and click event fix for goto menu --- src/css/styles.css | 52 +++++++++++++++ src/js/goto.js | 157 ++++++++++++++++++++++++--------------------- 2 files changed, 137 insertions(+), 72 deletions(-) diff --git a/src/css/styles.css b/src/css/styles.css index 067c412a6..c5bcd948e 100644 --- a/src/css/styles.css +++ b/src/css/styles.css @@ -366,3 +366,55 @@ textarea { flex-direction: column; align-items: flex-end; } + +/* goto context menu */ +#context-menu { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background: #fff; + border: 1px solid #ccc; + border-radius: 8px; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + width: 300px; + z-index: 1000; +} + +.menu-container { + display: flex; + flex-direction: column; + padding: 10px; +} + +#menu-search { + padding: 8px; + margin-bottom: 10px; + border: 1px solid #ccc; + border-radius: 4px; + width: 100%; + font-size: 16px; +} + +#menu-items { + list-style: none; + padding: 0; + margin: 0; +} + +#menu-items li { + padding: 10px; + border-radius: 4px; + cursor: pointer; +} + +#menu-items li:focus { + outline: none; + background: #007bff; + color: #fff; +} + +#menu-items li:hover { + background: #007bff; + color: #fff; +} diff --git a/src/js/goto.js b/src/js/goto.js index 122e5d386..9ee310406 100644 --- a/src/js/goto.js +++ b/src/js/goto.js @@ -1,117 +1,130 @@ class Goto { //locations = ['Max Value', 'Min Value', 'Mean', 'Median']; - locations = ['Max Value', 'Min Value']; + static options = ['Max Value', 'Min Value']; constructor() { - this.popupOpen = false; - this.popupIndex = 0; - this.attachBootstrapModal(); + this.menuOpen = false; + this.initMenu(); this.attachEventListeners(); } - attachBootstrapModal() { - // Create modal container - const modalHtml = ` -