mediawiki-skins-Vector/resources/CheckboxHack.d.ts
Stephen Niedzielski 5195f5fd67 [feature] add menu button to toggle panel visibility
Add a menu button that toggles the panel's (also referred to as a
sidebar) collapse state. When the screen is wide enough, animate the
transition.

The menu icon from OOUI is copied into Vector to avoid two
ResourceLoaders modules (collapseHorizontal icon isn't ready for
inclusion in the OOUI icon pack and ResourceLoaderOOUIIconPackModule
doesn't support images).

Additional polish and collaboration is needed but this patch fulfills
the scope of its referenced task.

Bug: T246419
Depends-On: I8e153c0ab927f9d880a68fb9efb0bf37b91d26b2
Change-Id: Ic9d54de7e19ef8d5dfd703d95a45b78c0aaf791a
2020-05-28 02:14:13 +00:00

17 lines
1,019 B
TypeScript

interface CheckboxHack {
updateAriaExpanded(checkbox: HTMLInputElement): void;
bindUpdateAriaExpandedOnInput(checkbox: HTMLInputElement): CheckboxHackListeners;
bindToggleOnClick(checkbox: HTMLInputElement, button: HTMLElement): CheckboxHackListeners;
bindDismissOnClickOutside(window: Window, checkbox: HTMLInputElement, button: HTMLElement, target: Node): CheckboxHackListeners;
bindDismissOnFocusLoss(window: Window, checkbox: HTMLInputElement, button: HTMLElement, target: Node): CheckboxHackListeners;
bind(window: Window, checkbox: HTMLInputElement, button: HTMLElement, target: Node): CheckboxHackListeners;
unbind(window: Window, checkbox: HTMLInputElement, button: HTMLElement, listeners: CheckboxHackListeners): void;
}
interface CheckboxHackListeners {
onUpdateAriaExpandedOnInput?: EventListenerOrEventListenerObject;
onToggleOnClick?: EventListenerOrEventListenerObject;
onDismissOnClickOutside?: EventListenerOrEventListenerObject;
onDismissOnFocusLoss?: EventListenerOrEventListenerObject;
}