From f85a33f150861b3ebe66ed99cbdcb94e0418c9cd Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sat, 27 Oct 2018 13:10:28 +0200 Subject: [PATCH] Elastic: Fix TypeError: Argument 1 of MutationObserver.observe is not an object --- skins/elastic/ui.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/skins/elastic/ui.js b/skins/elastic/ui.js index 61bc8b673..f784e6493 100644 --- a/skins/elastic/ui.js +++ b/skins/elastic/ui.js @@ -679,6 +679,16 @@ function rcube_elastic_ui() rcmail.display_message(rcmail.gettext('nocontactselected'), 'warning'); } }); + + // Update compose status bar on attachments list update + if (window.MutationObserver) { + var observer, list = $('#attachment-list'), + status_callback = function() { compose_status('attach', list.children().length > 0); }; + + observer = new MutationObserver(status_callback); + observer.observe(list[0], {childList: true}); + status_callback(); + } } // Append contact menu to all mailto: links @@ -687,16 +697,6 @@ function rcube_elastic_ui() mailtomenu_append(this); }); } - - // Update compose status bar on attachments list update - if (window.MutationObserver) { - var observer, list = $('#attachment-list'), - status_callback = function() { compose_status('attach', list.children().length > 0); }; - - observer = new MutationObserver(status_callback); - observer.observe(list[0], {childList: true}); - status_callback(); - } } else if (rcmail.task == 'settings') { rcmail.addEventListener('identity-encryption-show', function(p) {