mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-02 07:05:24 +00:00
Backed out changeset cce44d592e67 (bug 822848)
This commit is contained in:
parent
a36af980fd
commit
3d84247a2f
@ -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;
|
||||
},
|
||||
|
@ -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">
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user