From bc7c66fec98d987b09a1a39ac8c640535ab32309 Mon Sep 17 00:00:00 2001 From: dlandon Date: Wed, 9 Oct 2024 12:06:48 -0500 Subject: [PATCH] Delete share is always visible and enabled only when it is safe to delete the share. --- emhttp/plugins/dynamix/ShareEdit.page | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/emhttp/plugins/dynamix/ShareEdit.page b/emhttp/plugins/dynamix/ShareEdit.page index 093ad9ff6..8cb0a51f2 100644 --- a/emhttp/plugins/dynamix/ShareEdit.page +++ b/emhttp/plugins/dynamix/ShareEdit.page @@ -541,14 +541,10 @@ _(Mover action)_:   : -
-_(Delete)_ +
+ :
-
-  -: -
@@ -1297,13 +1293,24 @@ function handleDeleteClick(button) { $(function() { + + $.post('/webGui/include/ShareList.php', { scan: "" }, function(e) { if (e == 1) { $('.empty').show(); $('.full').hide(); + /* Enable delete checkbox and update tooltip. */ + $('input[name="confirmDelete"]').prop('disabled', false).attr('title', ''); + $('#deleteLabel').attr('title', ''); } else { $('.full1').hide(); $('.full2').show(); + /* Disable delete checkbox and update tooltip. */ + $('input[name="confirmDelete"]').prop('disabled', true).attr('title', ''); + $('#deleteLabel').attr('title', ''); } });