From 0cb523f3f70a42c59e79a87c3626eabd235118b4 Mon Sep 17 00:00:00 2001 From: "pavlov%pavlov.net" Date: Wed, 1 Jun 2005 01:11:24 +0000 Subject: [PATCH] enable/disable elements in the duration radiogroup git-svn-id: svn://10.0.0.236/trunk@173865 18797224-902f-48f8-a5cc-f745e15eee43 --- .../content/calendar-recurrence-dialog.js | 22 +++++++++++++++++++ .../content/calendar-recurrence-dialog.xul | 4 ++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/mozilla/calendar/base/content/calendar-recurrence-dialog.js b/mozilla/calendar/base/content/calendar-recurrence-dialog.js index 4adf196dea6..261685da3ed 100644 --- a/mozilla/calendar/base/content/calendar-recurrence-dialog.js +++ b/mozilla/calendar/base/content/calendar-recurrence-dialog.js @@ -48,6 +48,8 @@ function onLoad() updateDeck(); + updateDuration(); + opener.setCursor("auto"); self.focus(); @@ -203,3 +205,23 @@ function updateDeck() document.getElementById("period-deck").selectedIndex = Number(getElementValue("period-list")); } +function updateDuration() +{ + var durationSelection = document.getElementById("recurrence-duration").selectedItem.value; + if (durationSelection == "forever") { + } + + if (durationSelection == "ntimes") { + setElementValue("repeat-ntimes-count", false, "disabled"); + setElementValue("repeat-ntimes-units", false, "disabled"); + } else { + setElementValue("repeat-ntimes-count", "true", "disabled"); + setElementValue("repeat-ntimes-units", "true", "disabled"); + } + + if (durationSelection == "until") { + setElementValue("repeat-until-date", false, "disabled"); + } else { + setElementValue("repeat-until-date", "true", "disabled"); + } +} diff --git a/mozilla/calendar/base/content/calendar-recurrence-dialog.xul b/mozilla/calendar/base/content/calendar-recurrence-dialog.xul index 4bd2725a87c..d85f2b0621e 100644 --- a/mozilla/calendar/base/content/calendar-recurrence-dialog.xul +++ b/mozilla/calendar/base/content/calendar-recurrence-dialog.xul @@ -135,7 +135,7 @@ - + @@ -152,7 +152,7 @@ - +