From d40681237af9a8a0873ebd2b069d87eeb68d696f Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sun, 23 Aug 2020 12:05:22 +0200 Subject: [PATCH] Replace Import/Cancel buttons with Close button after successful contacts import --- program/js/app.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/program/js/app.js b/program/js/app.js index 73d5c0a1b..a7a73f892 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -5787,8 +5787,18 @@ function rcube_webmail() { if (this.import_dialog) { this.import_state = state; - // activate Import button depending on state - $(this.import_dialog).parent().find('.ui-dialog-buttonset > button').first().attr('disabled', state != 'error'); + + var button = $(this.import_dialog).parent().find('.ui-dialog-buttonset > button').first(); + + if (state != 'error') { + // replace Import/Cancel buttons with Close button + button.hide(); + button.next().text(this.gettext('close')).focus(); + } + else { + // activate the Import button + button.prop('disabled', false); + } } };