Bug 1304617 - Avoid using the ordinal attribute for positioning the Hide / Show Recently Bookmarked menu items. r=mak

This commit is contained in:
Dão Gottwald 2016-10-13 18:47:52 +02:00
Родитель c2b1b76799
Коммит dfd29d920e
2 изменённых файлов: 12 добавлений и 6 удалений

Просмотреть файл

@ -1417,9 +1417,18 @@ var BookmarkingUI = {
let updatePlacesContextMenu = (shouldHidePrefUI = false) => {
let prefEnabled = !shouldHidePrefUI && Services.prefs.getBoolPref(this.RECENTLY_BOOKMARKED_PREF);
document.getElementById("placesContext_showRecentlyBookmarked").hidden = shouldHidePrefUI || prefEnabled;
document.getElementById("placesContext_hideRecentlyBookmarked").hidden = shouldHidePrefUI || !prefEnabled;
document.getElementById("placesContext_recentlyBookmarkedSeparator").hidden = shouldHidePrefUI;
let showItem = document.getElementById("placesContext_showRecentlyBookmarked");
let hideItem = document.getElementById("placesContext_hideRecentlyBookmarked");
let separator = document.getElementById("placesContext_recentlyBookmarkedSeparator");
showItem.hidden = shouldHidePrefUI || prefEnabled;
hideItem.hidden = shouldHidePrefUI || !prefEnabled;
separator.hidden = shouldHidePrefUI;
if (!shouldHidePrefUI) {
// Move to the bottom of the menu.
separator.parentNode.appendChild(separator);
showItem.parentNode.appendChild(showItem);
hideItem.parentNode.appendChild(hideItem);
}
};
let onPlacesContextMenuShowing = event => {

Просмотреть файл

@ -361,7 +361,6 @@
<menupopup id="placesContext">
<menuseparator id="placesContext_recentlyBookmarkedSeparator"
ignoreitem="true"
ordinal="2"
hidden="true"/>
<menuitem id="placesContext_hideRecentlyBookmarked"
label="&hideRecentlyBookmarked.label;"
@ -369,7 +368,6 @@
oncommand="BookmarkingUI.hideRecentlyBookmarked();"
closemenu="single"
ignoreitem="true"
ordinal="2"
hidden="true"/>
<menuitem id="placesContext_showRecentlyBookmarked"
label="&showRecentlyBookmarked.label;"
@ -377,7 +375,6 @@
oncommand="BookmarkingUI.showRecentlyBookmarked();"
closemenu="single"
ignoreitem="true"
ordinal="2"
hidden="true"/>
</menupopup>