Skip to content

Commit

Permalink
Add cursor:pointer for hover states
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredkhan committed Nov 13, 2024
1 parent 24783ac commit ea45b05
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions OZprivate/rawJS/OZTreeModule/src/render/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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.
Expand Down

0 comments on commit ea45b05

Please sign in to comment.