From a4df8df5e517f692de4a7afb69eea045b9387572 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 19 May 2021 20:29:31 -0400 Subject: [PATCH] Fix status of delete button when archived. Change title to say that you can't delete due to archived --- web/skins/classic/views/js/event.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/skins/classic/views/js/event.js b/web/skins/classic/views/js/event.js index b3819cf30..53e42dcc8 100644 --- a/web/skins/classic/views/js/event.js +++ b/web/skins/classic/views/js/event.js @@ -936,7 +936,8 @@ function initPage() { editBtn.prop('disabled', !canEdit.Events); exportBtn.prop('disabled', !canView.Events); downloadBtn.prop('disabled', !canView.Events); - deleteBtn.prop('disabled', !canEdit.Events); + deleteBtn.prop('disabled', !(!eventData.Archived && canEdit.Events)); + deleteBtn.prop('title', eventData.Archived ? "You cannot delete an archived event." : ""); // Don't enable the back button if there is no previous zm page to go back to backBtn.prop('disabled', !document.referrer.length); @@ -979,14 +980,14 @@ function initPage() { // Manage the UNARCHIVE button bindButton('#unarchiveBtn', 'click', null, function onUnarchiveClick(evt) { - if ( ! canEdit.Events ) { + if (!canEdit.Events) { enoperm(); return; } evt.preventDefault(); $j.getJSON(thisUrl + '?request=events&task=unarchive&eids[]='+eventData.Id) .done( function(data) { - //FIXME: update the status of the unarchive button reather than reload the whole page + //FIXME: update the status of the unarchive button rather than reload the whole page window.location.reload(true); }) .fail(logAjaxFail);