Add comment to dropdownMenus.js regarding the CHECKBOX_HACK_BUTTON_SELECTOR

Per request [1], a clarifying comment was added explaining that our
checkbox hack implementation has drifted from the core's recommendation.

[1] https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/732732/2/resources/skins.vector.js/dropdownMenus.js#7

Bug: T291096
Change-Id: I3a5bc9d463bace11185affbb21320d86fc1c5d99
This commit is contained in:
Nicholas Ray 2021-11-02 17:58:52 -06:00
parent ea0f0a26fd
commit 7f58c88934
1 changed files with 4 additions and 0 deletions

View File

@ -4,6 +4,10 @@ var
checkboxHack = /** @type {CheckboxHack} */ require( /** @type {string} */( 'mediawiki.page.ready' ) ).checkboxHack,
CHECKBOX_HACK_CONTAINER_SELECTOR = '.vector-menu-dropdown',
CHECKBOX_HACK_CHECKBOX_SELECTOR = '.vector-menu-checkbox',
// In core's checkboxHack.js, it is recommended to use a label element as a
// button that toggles the checkbox. In Vector's dropdown menus that use the
// Menu.mustache template, a checkbox is used as both the "button" and the
// "checkbox".
CHECKBOX_HACK_BUTTON_SELECTOR = '.vector-menu-checkbox',
CHECKBOX_HACK_TARGET_SELECTOR = '.vector-menu-content';