From ea45b05ad7a1bf5b6a6d7ec900cf29b3eb4a44bf Mon Sep 17 00:00:00 2001 From: Jared Khan Date: Sun, 10 Nov 2024 18:01:41 +0000 Subject: [PATCH] Add cursor:pointer for hover states --- .../rawJS/OZTreeModule/src/render/renderer.js | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/OZprivate/rawJS/OZTreeModule/src/render/renderer.js b/OZprivate/rawJS/OZTreeModule/src/render/renderer.js index ebd7bb20..0898744f 100755 --- a/OZprivate/rawJS/OZTreeModule/src/render/renderer.js +++ b/OZprivate/rawJS/OZTreeModule/src/render/renderer.js @@ -63,6 +63,7 @@ function refresh(root) { if (need_refresh()) { controller.projection.get_shapes(root, shapes); + update_cursor(); if (is_on_mobile && tree_state.is_dragging()) { refresh_by_image(shapes); } else { @@ -75,6 +76,27 @@ function refresh(root) { } } +function update_cursor() { + if (tree_state.mouse_hold) { + canvas.style.cursor = "move"; + return; + } + switch(global_button_action.action) { + case "fly_node": + case "tap2zoom": + case "ow_node": + case "ow_ozspons_node": + case "ow_ozspons_leaf": + case "ow_leaf": + case "ow_iucn_leaf": + case "link": + case "leap": + canvas.style.cursor = "pointer"; + break; + default: + canvas.style.cursor = "default"; + } +} /** * This function would first dynamically develop undeveloped parts.