From d5adf61658fef04397030c09ba5f446d61826368 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Mon, 3 May 2010 18:26:11 +0200 Subject: [PATCH] Fix setting and hiding the Delete button in the calendar dialog. --- kronolith/js/kronolith.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 6533b9636..35a844bfc 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -2571,16 +2571,20 @@ KronolithCore = { } form.down('.kronolithCalendarSubscribe').hide(); form.down('.kronolithCalendarUnsubscribe').hide(); - if (newCalendar || calendar == Kronolith.conf.user) { - form.down('.kronolithCalendarDelete').hide(); - } else { - form.down('.kronolithCalendarDelete').show(); - } $('kronolithCalendar' + type + 'LinkPerms').up('li').show(); if (!Object.isUndefined(info) && info.owner) { this.setPermsFields(type, info.perms); } } + if (type == 'remote' || type == 'internal' || type == 'tasklists') { + if (newCalendar || + (type == 'internal' && calendar == Kronolith.conf.user) || + (type == 'tasklists' && calendar == 'tasks/' + Kronolith.conf.user)) { + form.select('.kronolithCalendarDelete').invoke('hide'); + } else { + form.select('.kronolithCalendarDelete').invoke('show'); + } + } form.down('.kronolithCalendarSave').show(); form.down('.kronolithFormActions .kronolithSeparator').show(); } else { -- 2.11.0