From 1b109edcc208a7dc0894b00f467663a711609f47 Mon Sep 17 00:00:00 2001 From: "slamm%netscape.com" Date: Tue, 30 Nov 1999 06:18:58 +0000 Subject: [PATCH] Partial fix for bug 20200. Only allow one tree to have selection at a time. Not part of the build. --- suite/common/sidebar/customize.js | 14 ++++++++++++++ xpfe/components/sidebar/resources/customize.js | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/suite/common/sidebar/customize.js b/suite/common/sidebar/customize.js index 026a5d187ada..cb3ada0c9c43 100644 --- a/suite/common/sidebar/customize.js +++ b/suite/common/sidebar/customize.js @@ -123,7 +123,12 @@ function getAttr(registry,service,attr_name) { } function selectChange() { + // Remove the selection in the other list + var other_panels = document.getElementById('other-panels'); + other_panels.clearItemSelection(); + enableButtons(); + enableOtherButtons(); } function moveUp() { @@ -286,6 +291,11 @@ function Save() function otherPanelSelected(event, target) { + // Remove the selection in the "current" panels list + var current_panels = document.getElementById('selected-panels'); + current_panels.clearItemSelection(); + enableButtons(); + if (target.getAttribute('container') == 'true') { if (target.getAttribute('open') == 'true') { target.removeAttribute('open'); @@ -294,7 +304,11 @@ function otherPanelSelected(event, target) } return; } + enableOtherButtons(); +} +function enableOtherButtons() +{ var add_button = document.getElementById('add_button'); var preview_button = document.getElementById('preview_button'); var other_panels = document.getElementById('other-panels'); diff --git a/xpfe/components/sidebar/resources/customize.js b/xpfe/components/sidebar/resources/customize.js index 026a5d187ada..cb3ada0c9c43 100644 --- a/xpfe/components/sidebar/resources/customize.js +++ b/xpfe/components/sidebar/resources/customize.js @@ -123,7 +123,12 @@ function getAttr(registry,service,attr_name) { } function selectChange() { + // Remove the selection in the other list + var other_panels = document.getElementById('other-panels'); + other_panels.clearItemSelection(); + enableButtons(); + enableOtherButtons(); } function moveUp() { @@ -286,6 +291,11 @@ function Save() function otherPanelSelected(event, target) { + // Remove the selection in the "current" panels list + var current_panels = document.getElementById('selected-panels'); + current_panels.clearItemSelection(); + enableButtons(); + if (target.getAttribute('container') == 'true') { if (target.getAttribute('open') == 'true') { target.removeAttribute('open'); @@ -294,7 +304,11 @@ function otherPanelSelected(event, target) } return; } + enableOtherButtons(); +} +function enableOtherButtons() +{ var add_button = document.getElementById('add_button'); var preview_button = document.getElementById('preview_button'); var other_panels = document.getElementById('other-panels');