Bug 381218 - Organizer's view menu is broken. r=sspitzer.

This commit is contained in:
mozilla.mano@sent.com 2007-05-19 17:44:57 -07:00
Родитель 35d337f280
Коммит de13508f22
2 изменённых файлов: 41 добавлений и 19 удалений

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

@ -1039,7 +1039,7 @@ var ViewMenu = {
if (column.primary)
menuitem.setAttribute("disabled", "true");
// Items for visible columns are checked.
if (column.hidden)
if (!column.hidden)
menuitem.setAttribute("checked", "true");
}
if (pivot)
@ -1097,11 +1097,13 @@ var ViewMenu = {
if (element.getAttribute("checked") == "true") {
column.removeAttribute("hidden");
splitter.removeAttribute("hidden");
if (splitter)
splitter.removeAttribute("hidden");
}
else {
column.setAttribute("hidden", "true");
splitter.setAttribute("hidden", "true");
if (splitter)
splitter.setAttribute("hidden", "true");
}
},
@ -1148,34 +1150,46 @@ var ViewMenu = {
aColumnID = sortColumn ? sortColumn.id : "title";
var sortingMode;
var sortingAnnotation = "";
const NHQO = Ci.nsINavHistoryQueryOptions;
switch (aColumnID) {
case "title":
if (aDirection == "descending")
sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_TITLE_DESCENDING;
else
sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_TITLE_ASCENDING;
sortingMode = aDirection == "descending" ?
NHQO.SORT_BY_TITLE_DESCENDING : NHQO.SORT_BY_TITLE_ASCENDING;
break;
case "url":
if (aDirection == "descending")
sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_URI_DESCENDING;
else
sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_URI_ASCENDING;
sortingMode = aDirection == "descending" ?
NHQO.SORT_BY_URI_DESCENDING : NHQO.SORT_BY_URI_ASCENDING;
break;
case "date":
if (aDirection == "descending")
sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING;
else
sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_ASCENDING;
sortingMode = aDirection == "descending" ?
NHQO.SORT_BY_DATE_DESCENDING : NHQO.SORT_BY_DATE_ASCENDING;
break;
case "visitCount":
if (aDirection == "descending")
sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_VISITCOUNT_DESCENDING;
else
sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_VISITCOUNT_ASCENDING;
sortingMode = aDirection == "descending" ?
NHQO.SORT_BY_VISITCOUNT_DESCENDING : NHQO.SORT_BY_VISITCOUNT_ASCENDING;
break;
case "keyword":
sortingMode = aDirection == "descending" ?
NHQO.SORT_BY_KEYWORD_DESCENDING : NHQO.SORT_BY_KEYWORD_ASCENDING;
break;
case "description":
sortingAnnotation = DESCRIPTION_ANNO;
sortingMode = aDirection == "descending" ?
NHQO.SORT_BY_ANNOTATION_DESCENDING : NHQO.SORT_BY_ANNOTATION_ASCENDING;
break;
case "dateAdded":
sortingMode = aDirection == "descending" ?
NHQO.SORT_BY_DATEADDED_DESCENDING : NHQO.SORT_BY_DATEADDED_ASCENDING;
break;
case "lastModified":
sortingMode = aDirection == "descending" ?
NHQO.SORT_BY_LASTMODIFIED_DESCENDING : NHQO.SORT_BY_LASTMODIFIED_ASCENDING;
break;
default:
throw("Invalid Column");
}
result.sortingAnnotation = sortingAnnotation;
result.sortingMode = sortingMode;
}
};

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

@ -53,6 +53,14 @@ view.sortBy.date.label=Sort by Visit Date
view.sortBy.date.accesskey=V
view.sortBy.visitCount.label=Sort by Visit Count
view.sortBy.visitCount.accesskey=C
view.sortBy.keyword.label=Sort by Keyword
view.sortBy.keyword.accesskey=K
view.sortBy.description.label=Sort by Description
view.sortBy.description.accesskey=D
view.sortBy.dateAdded.label=Sort by Added
view.sortBy.dateAdded.accesskey=A
view.sortBy.lastModified.label=Sort by Last Modified
view.sortBy.lastModified.accesskey=M
searchDefault=Search in Bookmarks
searchCurrentDefault=Search in '%S'