From 7f58c88934537f3f02d8daa9fe2bf434cd205dea Mon Sep 17 00:00:00 2001 From: Nicholas Ray Date: Tue, 2 Nov 2021 17:58:52 -0600 Subject: [PATCH] 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 --- resources/skins.vector.js/dropdownMenus.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/skins.vector.js/dropdownMenus.js b/resources/skins.vector.js/dropdownMenus.js index a605bae..e8bf29d 100644 --- a/resources/skins.vector.js/dropdownMenus.js +++ b/resources/skins.vector.js/dropdownMenus.js @@ -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';