mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Added mouse events to index.ts for ol-select.
This commit is contained in:
parent
5b400d7cba
commit
eb4165ba82
@ -60,13 +60,32 @@ function setup() {
|
||||
|
||||
/* Generic clicks */
|
||||
document.addEventListener( "click", ( ev ) => {
|
||||
|
||||
if ( ev instanceof PointerEvent && ev.target instanceof HTMLElement ) {
|
||||
if ( ev.target.classList.contains( "olympus-dialog-close" ) ) {
|
||||
ev.target.closest( "div.olympus-dialog" )?.classList.add( "hide" );
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
/** Olympus UI ***/
|
||||
document.querySelectorAll( ".ol-select" ).forEach( select => {
|
||||
|
||||
// Do open/close toggle
|
||||
select.addEventListener( "click", ev => {
|
||||
select.classList.toggle( "is-open" );
|
||||
});
|
||||
|
||||
// Autoclose on mouseleave
|
||||
select.addEventListener( "mouseleave", ev => {
|
||||
select.classList.remove( "is-open" );
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
/* ATC */
|
||||
let atcFeatureSwitch = featureSwitches.getSwitch( "atc" );
|
||||
if ( atcFeatureSwitch?.isEnabled() ) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user