From 110c3339486c3fbc4d7b3a920e94930d4bd6d153 Mon Sep 17 00:00:00 2001 From: "slamm%netscape.com" Date: Fri, 29 Oct 1999 19:17:22 +0000 Subject: [PATCH] Fix 17347. Initialize the 'View | Sidebar' menu to the correct state. r=mozbot. --- suite/common/sidebar/sidebarOverlay.js | 33 ++++++++++--------- .../sidebar/resources/sidebarOverlay.js | 33 ++++++++++--------- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/suite/common/sidebar/sidebarOverlay.js b/suite/common/sidebar/sidebarOverlay.js index 9d3a9f27734b..a3b96c636110 100644 --- a/suite/common/sidebar/sidebarOverlay.js +++ b/suite/common/sidebar/sidebarOverlay.js @@ -74,23 +74,24 @@ function sidebarOverlayInit() if (sidebar_element.getAttribute('hidden') == 'true') { sidebar_element.setAttribute('style', 'display:none') sidebar_menuitem.setAttribute('checked', 'false') - return + } else { + sidebar_menuitem.setAttribute('checked', 'true'); + + debug("sidebar = " + sidebar + "\n"); + debug("sidebar.resource = " + sidebar.resource + "\n"); + debug("sidebar.db = " + sidebar.db + "\n"); + + // Add the user's current panel choices to the template builder, + // which will aggregate it with the other datasources that describe + // the individual panel's title, customize URL, and content URL. + var panels = document.getElementById('sidebar-panels'); + panels.database.AddDataSource(RDF.GetDataSource(sidebar.db)); + + // XXX This is a hack to force re-display + panels.setAttribute('ref', 'urn:sidebar:current-panel-list'); + + sidebarOpenDefaultPanel(1, 0); } - - debug("sidebar = " + sidebar + "\n"); - debug("sidebar.resource = " + sidebar.resource + "\n"); - debug("sidebar.db = " + sidebar.db + "\n"); - - // Add the user's current panel choices to the template builder, - // which will aggregate it with the other datasources that describe - // the individual panel's title, customize URL, and content URL. - var panels = document.getElementById('sidebar-panels'); - panels.database.AddDataSource(RDF.GetDataSource(sidebar.db)); - - // XXX This is a hack to force re-display - panels.setAttribute('ref', 'urn:sidebar:current-panel-list'); - - sidebarOpenDefaultPanel(1, 0); } function sidebarOpenDefaultPanel(wait, tries) { diff --git a/xpfe/components/sidebar/resources/sidebarOverlay.js b/xpfe/components/sidebar/resources/sidebarOverlay.js index 9d3a9f27734b..a3b96c636110 100644 --- a/xpfe/components/sidebar/resources/sidebarOverlay.js +++ b/xpfe/components/sidebar/resources/sidebarOverlay.js @@ -74,23 +74,24 @@ function sidebarOverlayInit() if (sidebar_element.getAttribute('hidden') == 'true') { sidebar_element.setAttribute('style', 'display:none') sidebar_menuitem.setAttribute('checked', 'false') - return + } else { + sidebar_menuitem.setAttribute('checked', 'true'); + + debug("sidebar = " + sidebar + "\n"); + debug("sidebar.resource = " + sidebar.resource + "\n"); + debug("sidebar.db = " + sidebar.db + "\n"); + + // Add the user's current panel choices to the template builder, + // which will aggregate it with the other datasources that describe + // the individual panel's title, customize URL, and content URL. + var panels = document.getElementById('sidebar-panels'); + panels.database.AddDataSource(RDF.GetDataSource(sidebar.db)); + + // XXX This is a hack to force re-display + panels.setAttribute('ref', 'urn:sidebar:current-panel-list'); + + sidebarOpenDefaultPanel(1, 0); } - - debug("sidebar = " + sidebar + "\n"); - debug("sidebar.resource = " + sidebar.resource + "\n"); - debug("sidebar.db = " + sidebar.db + "\n"); - - // Add the user's current panel choices to the template builder, - // which will aggregate it with the other datasources that describe - // the individual panel's title, customize URL, and content URL. - var panels = document.getElementById('sidebar-panels'); - panels.database.AddDataSource(RDF.GetDataSource(sidebar.db)); - - // XXX This is a hack to force re-display - panels.setAttribute('ref', 'urn:sidebar:current-panel-list'); - - sidebarOpenDefaultPanel(1, 0); } function sidebarOpenDefaultPanel(wait, tries) {