-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
29 lines (21 loc) · 790 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import $ from 'jquery';
import { pan } from 'ol/interaction/Interaction';
const actionBarHandler = ({ target }) => {
const actionID = target.id;
if (actionID === 'areaOfInterest') {
return;
}
const panelID = `${actionID}Panel`;
const panel = $(`calcite-shell-panel#${panelID}`);
console.log(actionID);
// If the clicked panel has the 'showData' class, set its class to 'hideData' and return
if (panel.hasClass('showData')) {
panel.attr('class', 'hideData');
return;
}
// Hide all 'calcite-shell-panel' elements whose 'id' ends with 'Panel'
$('calcite-shell-panel[id$="Panel"]').attr('class', 'hideData');
// Set the class of the clicked panel to 'showData'
panel.attr('class', 'showData');
};
$('calcite-action').on('click', actionBarHandler);