Skip to content

ui/panels/left/DisplayOptionsPanel

Classes

DisplayOptionsPanel

Defined in: ui/panels/left/DisplayOptionsPanel.ts:23

BasePanel - Abstract base class for all UI panels Provides common functionality for panel management including: - DOM element management - Event listener cleanup - Lifecycle methods - Common panel operations (collapse/expand)

Extends

Constructors

Constructor
new DisplayOptionsPanel(): DisplayOptionsPanel;

Defined in: ui/panels/left/DisplayOptionsPanel.ts:108

Returns

DisplayOptionsPanel

Overrides

BasePanel.constructor

Properties

panelElement
protected panelElement: HTMLElement | null = null;

Defined in: ui/panels/BasePanel.ts:14

Inherited from

BasePanel.panelElement

panelContent
protected panelContent: HTMLElement | null = null;

Defined in: ui/panels/BasePanel.ts:15

Inherited from

BasePanel.panelContent

collapseButton
protected collapseButton: HTMLElement | null = null;

Defined in: ui/panels/BasePanel.ts:16

Inherited from

BasePanel.collapseButton

listeners
protected listeners: ListenerRegistry;

Defined in: ui/panels/BasePanel.ts:17

Inherited from

BasePanel.listeners

panelSelector
protected panelSelector: string;

Defined in: ui/panels/BasePanel.ts:25

CSS selector for the panel container

Inherited from

BasePanel.panelSelector

contentId?
protected optional contentId?: string;

Defined in: ui/panels/BasePanel.ts:26

ID of the panel content element (optional)

Inherited from

BasePanel.contentId

Methods

init()
init(): void;

Defined in: ui/panels/BasePanel.ts:33

Initialize the panel Must be called after DOM is ready

Returns

void

Inherited from

BasePanel.init

toggleCollapse()
protected toggleCollapse(): void;

Defined in: ui/panels/BasePanel.ts:73

Toggle panel collapse state

Returns

void

Inherited from

BasePanel.toggleCollapse

addEventListener()
protected addEventListener(
   element, 
   event, 
   handler): void;

Defined in: ui/panels/BasePanel.ts:87

Add an event listener and track it for cleanup

Parameters
element

HTMLElement

event

string

handler

EventListener

Returns

void

Inherited from

BasePanel.addEventListener

bindEvent()
protected bindEvent(
   id, 
   event, 
   handler): HTMLElement | null;

Defined in: ui/panels/BasePanel.ts:100

Attach a tracked event listener to an element by ID, with the standard warn-if-missing handling that panels used to copy-paste. Returns the element so callers can chain further setup.

Parameters
id

string

event

string

handler

EventListener

Returns

HTMLElement | null

Inherited from

BasePanel.bindEvent

bindClick()
protected bindClick(id, handler): HTMLElement | null;

Defined in: ui/panels/BasePanel.ts:117

Attach a tracked click handler to an element by ID.

Parameters
id

string

handler

() => void

Returns

HTMLElement | null

Inherited from

BasePanel.bindClick

bindInput()
protected bindInput(id, handler): HTMLElement | null;

Defined in: ui/panels/BasePanel.ts:124

Attach a tracked 'input' handler that receives the input's value.

Parameters
id

string

handler

(value) => void

Returns

HTMLElement | null

Inherited from

BasePanel.bindInput

bindChange()
protected bindChange(id, handler): HTMLElement | null;

Defined in: ui/panels/BasePanel.ts:133

Attach a tracked 'change' handler that receives the select/input value.

Parameters
id

string

handler

(value) => void

Returns

HTMLElement | null

Inherited from

BasePanel.bindChange

bindCheckbox()
protected bindCheckbox(id, handler): HTMLElement | null;

Defined in: ui/panels/BasePanel.ts:143

Attach a tracked 'change' handler to a checkbox that receives its checked state.

Parameters
id

string

handler

(checked) => void

Returns

HTMLElement | null

Inherited from

BasePanel.bindCheckbox

setInputValue()
protected setInputValue(id, value): void;

Defined in: ui/panels/BasePanel.ts:152

Set an input/select value by element ID, ignoring missing elements.

Parameters
id

string

value

string | number

Returns

void

Inherited from

BasePanel.setInputValue

setChecked()
protected setChecked(id, checked): void;

Defined in: ui/panels/BasePanel.ts:160

Set a checkbox's checked state by element ID, ignoring missing elements.

Parameters
id

string

checked

boolean

Returns

void

Inherited from

BasePanel.setChecked

setText()
protected setText(id, text): void;

Defined in: ui/panels/BasePanel.ts:168

Set an element's text content by element ID, ignoring missing elements.

Parameters
id

string

text

string

Returns

void

Inherited from

BasePanel.setText

getElement()
protected getElement(selector): HTMLElement | null;

Defined in: ui/panels/BasePanel.ts:176

Get an element within the panel

Parameters
selector

string

Returns

HTMLElement | null

Inherited from

BasePanel.getElement

getElementById()
protected getElementById(id): HTMLElement | null;

Defined in: ui/panels/BasePanel.ts:184

Get an element by ID within the panel

Parameters
id

string

Returns

HTMLElement | null

Inherited from

BasePanel.getElementById

trackSubscription()
protected trackSubscription(unsubscribe): void;

Defined in: ui/panels/BasePanel.ts:193

Track an unsubscribe function (e.g. from StateManager.subscribe) so the subscription is released in destroy(). Without this, destroyed panels keep reacting to state changes on detached DOM.

Parameters
unsubscribe

() => void

Returns

void

Inherited from

BasePanel.trackSubscription

destroy()
destroy(): void;

Defined in: ui/panels/BasePanel.ts:205

Clean up panel resources

Returns

void

Inherited from

BasePanel.destroy

onDestroy()
protected onDestroy(): void;

Defined in: ui/panels/BasePanel.ts:215

Subclasses override this to perform custom cleanup

Returns

void

Inherited from

BasePanel.onDestroy

show()
show(): void;

Defined in: ui/panels/BasePanel.ts:222

Show the panel

Returns

void

Inherited from

BasePanel.show

hide()
hide(): void;

Defined in: ui/panels/BasePanel.ts:231

Hide the panel

Returns

void

Inherited from

BasePanel.hide

isVisible()
isVisible(): boolean;

Defined in: ui/panels/BasePanel.ts:240

Check if panel is visible

Returns

boolean

Inherited from

BasePanel.isVisible

onInit()
protected onInit(): void;

Defined in: ui/panels/left/DisplayOptionsPanel.ts:112

Subclasses override this to perform custom initialization

Returns

void

Overrides

BasePanel.onInit

setStateManager()
setStateManager(stateManager): void;

Defined in: ui/panels/left/DisplayOptionsPanel.ts:120

Set the state manager for coordinating with other panels

Parameters
stateManager

StateManager

Returns

void

setApp()
setApp(app): void;

Defined in: ui/panels/left/DisplayOptionsPanel.ts:138

Set the app reference for accessing MapOverlay

Parameters
app

App

Returns

void

setBooleanOption()
setBooleanOption(stateKey, value?): boolean | null;

Defined in: ui/panels/left/DisplayOptionsPanel.ts:560

Set (or toggle, when value is omitted) one of the boolean map display options from outside the panel. Console commands (SHOWTRAF, SWRAD, ...) use this so they drive the exact same storage + checkbox + state pipeline as a click on the corresponding checkbox.

Returns the applied value, or null when the stateKey is not a known boolean option (or the panel has no state manager yet).

Parameters
stateKey

keyof DisplayOptions

value?

boolean

Returns

boolean | null

update()
update(): void;

Defined in: ui/panels/left/DisplayOptionsPanel.ts:640

Update panel content (override in subclasses)

Returns

void

Overrides

BasePanel.update