зеркало из https://github.com/mozilla/gecko-dev.git
Bug 805206 - Keyboard accessible menuitem has a blank label. r=felipe, a=lsblakk
This commit is contained in:
Родитель
6ca2dedd6f
Коммит
ae3df05afa
|
@ -98,6 +98,11 @@ let SocialUI = {
|
|||
toggleCommand.setAttribute("label", label);
|
||||
toggleCommand.setAttribute("accesskey", accesskey);
|
||||
|
||||
let kbMenuitem = document.getElementById("menu_socialAmbientMenu");
|
||||
kbMenuitem.hidden = !Social.enabled;
|
||||
kbMenuitem.setAttribute("label", label);
|
||||
kbMenuitem.setAttribute("accesskey", accesskey);
|
||||
|
||||
SocialToolbar.init();
|
||||
SocialShareButton.init();
|
||||
SocialSidebar.init();
|
||||
|
@ -623,14 +628,17 @@ var SocialMenu = {
|
|||
let ambientMenuItems = submenu.getElementsByClassName("ambient-menuitem");
|
||||
for (let ambientMenuItem of ambientMenuItems)
|
||||
submenu.removeChild(ambientMenuItem);
|
||||
|
||||
let separator = document.getElementById("socialAmbientMenuSeparator");
|
||||
separator.hidden = true;
|
||||
let provider = Social.provider;
|
||||
if (Social.active && provider) {
|
||||
let iconNames = Object.keys(provider.ambientNotificationIcons);
|
||||
let separator = document.getElementById("socialAmbientMenuSeparator");
|
||||
for each(let name in iconNames) {
|
||||
let icon = provider.ambientNotificationIcons[name];
|
||||
if (!icon.label || !icon.menuURL)
|
||||
continue;
|
||||
separator.hidden = false;
|
||||
let menuitem = document.createElement("menuitem");
|
||||
menuitem.setAttribute("label", icon.label);
|
||||
menuitem.classList.add("ambient-menuitem");
|
||||
|
@ -639,9 +647,7 @@ var SocialMenu = {
|
|||
}, false);
|
||||
submenu.insertBefore(menuitem, separator);
|
||||
}
|
||||
separator.hidden = !iconNames.length;
|
||||
}
|
||||
document.getElementById("menu_socialAmbientMenu").hidden = !Social.enabled;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче