mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Commiting from the correct directory.
This commit is contained in:
@@ -68,10 +68,12 @@ function setup() {
|
||||
if ( target.classList.contains( "olympus-dialog-close" ) ) {
|
||||
target.closest( "div.olympus-dialog" )?.classList.add( "hide" );
|
||||
}
|
||||
|
||||
if ( target.dataset.hasOwnProperty( "onClick" ) ) {
|
||||
const eventName:string = target.dataset.onClick || "";
|
||||
const params:string = target.dataset.onClickParams || "{}";
|
||||
|
||||
const triggerElement = target.closest( "[data-on-click]" );
|
||||
|
||||
if ( triggerElement instanceof HTMLElement ) {
|
||||
const eventName:string = triggerElement.dataset.onClick || "";
|
||||
const params:string = triggerElement.dataset.onClickParams || "{}";
|
||||
|
||||
if ( eventName ) {
|
||||
document.dispatchEvent( new CustomEvent( eventName, {
|
||||
@@ -98,10 +100,12 @@ function setup() {
|
||||
});
|
||||
|
||||
|
||||
document.addEventListener( "toggleVisibility", ( ev:CustomEventInit ) => {
|
||||
|
||||
document.body.toggleAttribute( "data-hide-" + ev.detail.unitType )
|
||||
document.addEventListener( "toggleCoalitionVisibility", ( ev:CustomEventInit ) => {
|
||||
document.body.toggleAttribute( "data-hide-" + ev.detail.coalition );
|
||||
});
|
||||
|
||||
document.addEventListener( "toggleUnitVisibility", ( ev:CustomEventInit ) => {
|
||||
document.body.toggleAttribute( "data-hide-" + ev.detail.unitType );
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user