diff options
author | Aleksander Machniak <alec@alec.pl> | 2022-08-28 14:26:02 +0300 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2022-08-28 14:26:02 +0300 |
commit | 6c2da12218d7c031e3159dfcb79d1c8a7f1c1dc5 (patch) | |
tree | 16d533c69dee6b2127181a2008b15862535b238a | |
parent | a62f046ad112e42c8e33980e1e962c700dce6533 (diff) |
Fix bug where some dialogs in an eml attachment preview would not close on mobile (#8627)
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | program/js/app.js | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 67b64f099..441cdc92a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - Fix bug where "about:blank" page could trigger "load error" (#8554) - Fix bug where setting 'Clear Trash on Logout' to 'all messages' didn't work (#8687) - Fix bug where the attachment menu wouldn't disappear after an action is selected (#8691) +- Fix bug where some dialogs in an eml attachment preview would not close on mobile (#8627) ## Release 1.6.0 diff --git a/program/js/app.js b/program/js/app.js index 9c84ceb04..df1aa3926 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -8231,6 +8231,9 @@ function rcube_webmail() popup.dialog(options); + // Remember the jQuery instance (window), useful when closing the dialog + popup[0].jqref = $; + if (options.width) popup.width(options.width); if (options.height) @@ -8283,7 +8286,12 @@ function rcube_webmail() cancel_label = options.cancel_button || 'cancel', cancel_class = options.cancel_class || cancel_label.replace(/^[^\.]+\./i, ''), close_func = function(e, ui, dialog) { - (ref.is_framed() ? parent.$ : $)(dialog || this).dialog('close'); + if (!dialog) + dialog = this; + + // The dialog might got open in the current window, but also any of its parents (#8627) + // We have to use the jQuery object that did invoke the dialog, set in show_popup_dialog() + dialog.jqref(dialog).dialog('close'); if (options.cancel_func) options.cancel_func(e, ref); }, buttons = [{ |