diff --git a/client/src/index.ts b/client/src/index.ts index 9f9d19f4..a16d03a5 100644 --- a/client/src/index.ts +++ b/client/src/index.ts @@ -87,7 +87,7 @@ function requestUpdate() { /* Main update rate = 250ms is minimum time, equal to server update time. */ getUnits((data: UnitsData) => { getUnitsManager()?.update(data); - unitDataTable.refresh( data.units ); + getUnitDataTable().update( data.units ) checkSessionHash(data.sessionHash); }, false); setTimeout(() => requestUpdate(), getConnected() ? 250 : 1000); @@ -225,6 +225,10 @@ export function getMissionData() { return missionHandler; } +export function getUnitDataTable() { + return unitDataTable; +} + export function getUnitsManager() { return unitsManager; } diff --git a/client/src/units/unitdatatable.ts b/client/src/units/unitdatatable.ts index 0e8bde65..4149cebb 100644 --- a/client/src/units/unitdatatable.ts +++ b/client/src/units/unitdatatable.ts @@ -32,7 +32,17 @@ export class UnitDataTable { } - refresh( units:object ) { + show() { + this.getElement()?.closest( ".ol-dialog" )?.classList.remove( "hide" ); + } + + + toggle() { + this.getElement()?.closest( ".ol-dialog" )?.classList.toggle( "hide" ); + } + + + update( units:object ) { const unitsArray = Object.values( units ).sort( ( a, b ) => { @@ -90,14 +100,4 @@ export class UnitDataTable { } - - show() { - this.getElement()?.closest( ".ol-dialog" )?.classList.remove( "hide" ); - } - - - toggle() { - this.getElement()?.closest( ".ol-dialog" )?.classList.toggle( "hide" ); - } - } \ No newline at end of file