Fix component editor for document URL

Monotone-Parent: 6b27e776287f9677560ff81cbb45e7471959c9e0
Monotone-Revision: eca223304213a13e4a7b9e29e6e5cc41c3b1cdb3

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2009-06-30T01:41:27
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2009-06-30 01:41:27 +00:00
parent deda9f6511
commit 6209543ce0
4 changed files with 55 additions and 16 deletions

View File

@@ -43,6 +43,7 @@ function onPopupUrlWindow(event) {
}
urlInput.value = newUrl;
}
onWindowResize(event);
return false;
}
@@ -134,10 +135,31 @@ function onComponentEditorLoad(event) {
$("repeatList").observe("change", onPopupRecurrenceWindow);
$("reminderHref").observe("click", onPopupReminderWindow);
$("reminderList").observe("change", onPopupReminderWindow);
Event.observe(window, "resize", onWindowResize);
onPopupRecurrenceWindow(null);
onPopupReminderWindow(null);
}
function onWindowResize(event) {
var document = $("documentLabel");
var comment = $("commentArea");
var area = comment.select("textarea").first();
var offset = 6;
var height;
height = window.height() - comment.cumulativeOffset().top - offset;
if (document.visible())
height -= $("changeUrlButton").getHeight();
area.setStyle({ height: (height - offset*2) + "px" });
comment.setStyle({ height: (height - offset) + "px" });
return true;
}
function onPopupRecurrenceWindow(event) {
if (event)
preventDefault(event);