From ace991946f553af7fb0cd077b299e756ad94b84c Mon Sep 17 00:00:00 2001 From: PhilW Date: Sun, 29 Mar 2020 14:37:33 +0100 Subject: [PATCH] zipdownload: enable menu options when menu is opened --- plugins/zipdownload/zipdownload.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/zipdownload/zipdownload.js b/plugins/zipdownload/zipdownload.js index c2e7b4ead..59e3e02c5 100644 --- a/plugins/zipdownload/zipdownload.js +++ b/plugins/zipdownload/zipdownload.js @@ -26,8 +26,6 @@ window.rcmail && rcmail.addEventListener('init', function(evt) { var selected = list.get_selection().length; rcmail.enable_command('download', selected > 0); - rcmail.enable_command('download-eml', selected == 1); - rcmail.enable_command('download-mbox', 'download-maildir', selected > 1); }); // hook before default download action @@ -94,6 +92,11 @@ function rcmail_zipdownload(mode) // display download options menu function rcmail_zipdownload_menu(e) { + // Menu option status + var selected = rcmail.message_list.get_selection().length; + rcmail.enable_command('download-eml', selected == 1); + rcmail.enable_command('download-mbox', 'download-maildir', selected > 1); + // show (sub)menu for download selection rcmail.command('menu-open', 'zipdownload-menu', e && e.target ? e.target : rcmail.env.download_link, e);