diff --git a/browser/components/places/content/places.js b/browser/components/places/content/places.js index 5ac14a95a7b3..8229da597692 100644 --- a/browser/components/places/content/places.js +++ b/browser/components/places/content/places.js @@ -717,13 +717,11 @@ var PlacesOrganizer = { _fillDetailsPane: function PO__fillDetailsPane(aNodeList) { var infoBox = document.getElementById("infoBox"); - var itemsCountBox = document.getElementById("itemsCountBox"); + var detailsDeck = document.getElementById("detailsDeck"); // Make sure the infoBox UI is visible if we need to use it, we hide it // below when we don't. infoBox.hidden = false; - itemsCountBox.hidden = true; - let selectedNode = aNodeList.length == 1 ? aNodeList[0] : null; // If an input within a panel is focused, force-blur it so its contents @@ -748,7 +746,11 @@ var PlacesOrganizer = { (selectedNode.itemId == -1 && gEditItemOverlay.uri && gEditItemOverlay.uri == selectedNode.uri); - if (nodeIsSame && !infoBox.hidden && !gEditItemOverlay.multiEdit) { + if ( + nodeIsSame && + detailsDeck.selectedIndex == 1 && + !gEditItemOverlay.multiEdit + ) { return; } } @@ -758,6 +760,8 @@ var PlacesOrganizer = { gEditItemOverlay.uninitPanel(false); if (selectedNode && !PlacesUtils.nodeIsSeparator(selectedNode)) { + detailsDeck.selectedIndex = 1; + gEditItemOverlay.initPanel({ node: selectedNode, hiddenRows: ["folderPicker"], @@ -765,11 +769,13 @@ var PlacesOrganizer = { } else if (!selectedNode && aNodeList[0]) { if (aNodeList.every(PlacesUtils.nodeIsURI)) { let uris = aNodeList.map(node => Services.io.newURI(node.uri)); + detailsDeck.selectedIndex = 1; gEditItemOverlay.initPanel({ uris, hiddenRows: ["folderPicker", "location", "keyword", "name"], }); } else { + detailsDeck.selectedIndex = 0; let selectItemDesc = document.getElementById("selectItemDescription"); let itemsCountLabel = document.getElementById("itemsCountText"); selectItemDesc.hidden = false; @@ -781,6 +787,7 @@ var PlacesOrganizer = { infoBox.hidden = true; } } else { + detailsDeck.selectedIndex = 0; infoBox.hidden = true; let selectItemDesc = document.getElementById("selectItemDescription"); let itemsCountLabel = document.getElementById("itemsCountText"); @@ -803,7 +810,6 @@ var PlacesOrganizer = { ); } } - itemsCountBox.hidden = !infoBox.hidden; }, }; @@ -1292,7 +1298,7 @@ var ContentArea = { _specialViews: new Map(), init: function CA_init() { - this._box = document.getElementById("placesViewsBox"); + this._deck = document.getElementById("placesViewsDeck"); this._toolbar = document.getElementById("placesToolbar"); ContentTree.init(); this._setupView(); @@ -1356,16 +1362,12 @@ var ContentArea = { }, get currentView() { - let selectedPane = [...this._box.children].filter( - child => !child.hidden - )[0]; - return PlacesUIUtils.getViewForNode(selectedPane); + return PlacesUIUtils.getViewForNode(this._deck.selectedPanel); }, set currentView(aNewView) { let oldView = this.currentView; if (oldView != aNewView) { - oldView.associatedElement.hidden = true; - aNewView.associatedElement.hidden = false; + this._deck.selectedPanel = aNewView.associatedElement; // If the content area inactivated view was focused, move focus // to the new view. @@ -1397,8 +1399,8 @@ var ContentArea = { let options = this.currentViewOptions; // showDetailsPane. - let detailsPane = document.getElementById("detailsPane"); - detailsPane.hidden = !options.showDetailsPane; + let detailsDeck = document.getElementById("detailsDeck"); + detailsDeck.hidden = !options.showDetailsPane; // toolbarSet. for (let elt of this._toolbar.childNodes) { @@ -1431,7 +1433,7 @@ var ContentArea = { }, focus() { - this.currentView.associatedElement.focus(); + this._deck.selectedPanel.focus(); }, }; diff --git a/browser/components/places/content/places.xhtml b/browser/components/places/content/places.xhtml index d68489f1a77e..0820e25029cc 100644 --- a/browser/components/places/content/places.xhtml +++ b/browser/components/places/content/places.xhtml @@ -356,7 +356,9 @@ - + - - - diff --git a/browser/themes/linux/places/organizer.css b/browser/themes/linux/places/organizer.css index 7e410bee9c74..b601791241f9 100644 --- a/browser/themes/linux/places/organizer.css +++ b/browser/themes/linux/places/organizer.css @@ -91,7 +91,7 @@ } /* Info box */ -#detailsPane { +#detailsDeck { padding: 5px; } diff --git a/browser/themes/osx/places/organizer.css b/browser/themes/osx/places/organizer.css index 95c71f97e55c..2cac9d91c0e1 100644 --- a/browser/themes/osx/places/organizer.css +++ b/browser/themes/osx/places/organizer.css @@ -143,7 +143,7 @@ } /* Info box */ -#detailsPane { +#detailsDeck { border-top: 1px solid #919191; background-color: #f0f0f0; padding: 10px; diff --git a/browser/themes/windows/places/organizer.css b/browser/themes/windows/places/organizer.css index 8a0f31f59c47..ece64326d7c8 100644 --- a/browser/themes/windows/places/organizer.css +++ b/browser/themes/windows/places/organizer.css @@ -108,7 +108,7 @@ /* Info box */ -#detailsPane { +#detailsDeck { border-top: 1px solid var(--organizer-border-color); padding: 5px; } @@ -240,7 +240,7 @@ background-color: var(--organizer-background-primary-color); } - #detailsPane { + #detailsDeck { background-color: var(--organizer-background-intermediate-color); color: var(--organizer-text-primary-color); }