Backed out changeset cce44d592e67 (bug 822848)

This commit is contained in:
Josh Matthews 2012-12-27 20:44:20 -05:00
parent ea13d2b4f6
commit 1dc8a36934
3 changed files with 7 additions and 38 deletions

View File

@ -882,8 +882,8 @@ DownloadsPlacesView.prototype = {
let placesNodes = [];
let selectedElements = this._richlistbox.selectedItems;
for (let elt of selectedElements) {
if (elt._shell.placesNode)
placesNodes.push(elt._shell.placesNode);
if (elt.placesNode)
placesNodes.push(elt.placesNode);
}
return placesNodes;
},

View File

@ -14,8 +14,7 @@
Components.interfaces.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING;
ContentArea.setContentViewForQueryString(DOWNLOADS_QUERY,
function() new DownloadsPlacesView(document.getElementById("downloadsRichListBox")),
{ showDetailsPane: false });
function() new DownloadsPlacesView(document.getElementById("downloadsRichListBox")));
]]></script>
<window id="places">

View File

@ -274,13 +274,6 @@ var PlacesOrganizer = {
* Handle focus changes on the places list and the current content view.
*/
updateDetailsPane: function PO_updateDetailsPane() {
let detailsDeck = document.getElementById("detailsDeck");
let detailsPaneDisabled = detailsDeck.hidden =
!ContentArea.currentViewOptions.showDetailsPane;
if (detailsPaneDisabled) {
return;
}
let view = PlacesUIUtils.getViewForNode(document.activeElement);
if (view) {
let selectedNodes = view.selectedNode ?
@ -1268,10 +1261,10 @@ let ContentArea = {
function CA_getContentViewForQueryString(aQueryString) {
try {
if (this._specialViews.has(aQueryString)) {
let { view, options } = this._specialViews.get(aQueryString);
let view = this._specialViews.get(aQueryString);
if (typeof view == "function") {
view = view();
this._specialViews.set(aQueryString, { view: view, options: options });
this._specialViews.set(aQueryString, view);
}
return view;
}
@ -1290,18 +1283,14 @@ let ContentArea = {
* @param aView
* Either the custom view or a function that will return the view
* the first (and only) time it's called.
* @param [optional] aOptions
* Object defining special options for the view.
* @see ContentTree.viewOptions for supported options and default values.
*/
setContentViewForQueryString:
function CA_setContentViewForQueryString(aQueryString, aView, aOptions) {
function CA_setContentViewForQueryString(aQueryString, aView) {
if (!aQueryString ||
typeof aView != "object" && typeof aView != "function")
throw new Error("Invalid arguments");
this._specialViews.set(aQueryString, { view: aView,
options: aOptions || new Object() });
this._specialViews.set(aQueryString, aView);
},
get currentView() PlacesUIUtils.getViewForNode(this._deck.selectedPanel),
@ -1318,23 +1307,6 @@ let ContentArea = {
return aQueryString;
},
/**
* Options for the current view.
*
* @see ContentTree.viewOptions for supported options and default values.
*/
get currentViewOptions() {
// Use ContentTree options as default.
let viewOptions = ContentTree.viewOptions;
if (this._specialViews.has(this.currentPlace)) {
let { view, options } = this._specialViews.get(this.currentPlace);
for (let option in options) {
viewOptions[option] = options[option];
}
}
return viewOptions;
},
focus: function() {
this._deck.selectedPanel.focus();
}
@ -1347,8 +1319,6 @@ let ContentTree = {
get view() this._view,
get viewOptions() Object.seal({ showDetailsPane: true }),
openSelectedNode: function CT_openSelectedNode(aEvent) {
let view = this.view;
PlacesUIUtils.openNodeWithEvent(view.selectedNode, aEvent, view);