Skip to content

Commit

Permalink
style: 💡 Update prettier style and comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mariewah committed Oct 9, 2025
1 parent 2bacc89 commit ecd26f6
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/ElevationControl/elevationControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ window.createElevationPanel = function createElevationPanel(viewer) {
}
}

//Select the fist pointcloud in the sidebar so that the Elevation section is built
/**
* Select the fist pointcloud in the sidebar so that the Elevation section is built
*/
function autoSelectFirstPointCloud() {
const cloudIcon = document.querySelector(
'#scene_objects i.jstree-themeicon-custom'
Expand All @@ -49,21 +51,25 @@ function autoSelectFirstPointCloud() {
return false
}

/**
* Disable any further clicks of the pointcloud icon in the sidebar
*/
function disableFirstPointCloudNode() {
// find the <li> that holds the first cloud icon
const icon = document.querySelector('#scene_objects i.jstree-themeicon-custom')
const li = icon ? icon.closest('li') : null;
if (!li) return;
const icon = document.querySelector(
'#scene_objects i.jstree-themeicon-custom'
)
const li = icon ? icon.closest('li') : null
if (!li) return
//visually/DOM disable anchor clicks
const a = li.querySelector('a');
const a = li.querySelector('a')
if (a) {
a.style.pointerEvents = 'none'
a.style.opacity = 0.5
a.classList.remove('jstree-clicked')
}
}


//(re)connect the elevation labels to the slider after the container is moved (was not handled by default)
function rebindElevationLabel() {
const slider = window.jQuery ? window.jQuery('#sldHeightRange') : null
Expand Down Expand Up @@ -126,6 +132,6 @@ export function initElevationControls(viewer) {
//Trigger Potree to build Materials UI by selecting the first point cloud (if nothing selected yet)
if (autoSelectFirstPointCloud()) {
//Prevent multiple clicks on the cloud icon
disableFirstPointCloudNode();
}
disableFirstPointCloudNode()
}
}

0 comments on commit ecd26f6

Please sign in to comment.