Monotone-Parent: efb32ee0b07634ff28f86f07c618160d8d121225

Monotone-Revision: 9e683df87b2b67f61552768bc12e69f0d289640e

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2007-11-19T22:19:17
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2007-11-19 22:19:17 +00:00
parent ddd0b2f653
commit ad10b8ee49
6 changed files with 36 additions and 7 deletions

View File

@@ -1363,6 +1363,21 @@ function browseURL(anchor, event) {
return false;
}
function onCalendarsMenuPrepareVisibility() {
var folders = $("calendarList");
var selected = folders.getSelectedNodes();
if (selected.length > 0) {
var folderOwner = selected[0].getAttribute("owner");
var sharingOption = $(this).down("ul").childElements().last();
// Disable the "Sharing" option when calendar is not owned by user
if (folderOwner == UserLogin)
sharingOption.removeClassName("disabled");
else
sharingOption.addClassName("disabled");
}
}
function getMenus() {
var menus = {};
@@ -1388,13 +1403,20 @@ function getMenus() {
null, "-", onMenuSharing);
menus["searchMenu"] = new Array(setSearchCriteria);
var calendarsMenu = $("calendarsMenu");
if (calendarsMenu)
calendarsMenu.prepareVisibility = onCalendarsMenuPrepareVisibility;
return menus;
}
function onMenuSharing(event) {
if ($(this).hasClassName("disabled"))
return;
var folders = $("calendarList");
var selected = folders.getSelectedNodes()[0];
/* FIXME: activation of the context menu should preferable select the entry
/* FIXME: activation of the context menu should preferably select the entry
above which the event has occured */
if (selected) {
var folderID = selected.getAttribute("id");