зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1672792 - Indicate shortcuts key to Alt > View > Toolbars > Bookmarks Toolbar menu. r=mtigley
Differential Revision: https://phabricator.services.mozilla.com/D95805
This commit is contained in:
Родитель
2cd43509dc
Коммит
f0682f7b1d
|
@ -1606,6 +1606,14 @@ var BookmarkingUI = {
|
|||
menuItem.dataset.visibilityEnum = visibilityEnum;
|
||||
menuItem.addEventListener("command", onViewToolbarCommand);
|
||||
});
|
||||
let menuItemForNextStateFromKbShortcut =
|
||||
gBookmarksToolbarVisibility == "never"
|
||||
? alwaysShowMenuItem
|
||||
: alwaysHideMenuItem;
|
||||
menuItemForNextStateFromKbShortcut.setAttribute(
|
||||
"key",
|
||||
"viewBookmarksToolbarKb"
|
||||
);
|
||||
|
||||
return menu;
|
||||
},
|
||||
|
|
|
@ -131,6 +131,18 @@ async function testIsBookmarksMenuItemStateChecked(expected) {
|
|||
`checked menuitem should be ${expected}`
|
||||
);
|
||||
|
||||
for (let menuitem of menuitems) {
|
||||
if (menuitem.dataset.visibilityEnum == expected) {
|
||||
ok(!menuitem.hasAttribute("key"), "dont show shortcut on current state");
|
||||
} else {
|
||||
is(
|
||||
menuitem.hasAttribute("key"),
|
||||
menuitem.dataset.visibilityEnum != "newtab",
|
||||
"shortcut is on the menuitem opposite of the current state excluding newtab"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
await closeContextMenu(contextMenu);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче