From ab092e4b98b2e87e4e0d767b06fdab6f9017a7b8 Mon Sep 17 00:00:00 2001 From: "pavlov%pavlov.net" Date: Wed, 15 Jun 2005 18:45:34 +0000 Subject: [PATCH] removing use of the obsolete dialogOverlay and adding code to disable the accept button if there is no event title entered --- calendar/base/content/calendar-event-dialog.js | 15 +++++++++++++++ calendar/base/content/calendar-event-dialog.xul | 6 ++---- .../base/content/calendar-recurrence-dialog.xul | 2 -- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/calendar/base/content/calendar-event-dialog.js b/calendar/base/content/calendar-event-dialog.js index 4cee6432affe..e68393dfaeb7 100644 --- a/calendar/base/content/calendar-event-dialog.js +++ b/calendar/base/content/calendar-event-dialog.js @@ -56,6 +56,9 @@ function onLoad() loadDialog(window.calendarEvent); + // update the accept button + updateAccept(); + // update datetime pickers updateAllDay(); @@ -235,6 +238,18 @@ function saveDialog(event) } +function updateAccept() +{ + var acceptButton = document.getElementById("calendar-event-dialog").getButton("accept"); + + var title = getElementValue("event-title"); + if (title.length == 0) + acceptButton.setAttribute("disabled", "true"); + else if (acceptButton.getAttribute("disabled")) + acceptButton.removeAttribute("disabled"); +} + + function updateAllDay() { var allDay = getElementValue("event-all-day", "checked"); diff --git a/calendar/base/content/calendar-event-dialog.xul b/calendar/base/content/calendar-event-dialog.xul index f7b3a605d6a8..337f957a41dd 100644 --- a/calendar/base/content/calendar-event-dialog.xul +++ b/calendar/base/content/calendar-event-dialog.xul @@ -42,10 +42,8 @@ - -