From 78f9de6d3c3f279741c1a8fd209e4e34d0eb9b76 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 11 Feb 2016 16:49:47 +0100 Subject: [PATCH] Fix redundant HTTP requests when opening/closing "Add a note" dialog (#4187) --- plugins/kolab_notes/notes_mail.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/kolab_notes/notes_mail.js b/plugins/kolab_notes/notes_mail.js index 7b925f24..ce5854a5 100644 --- a/plugins/kolab_notes/notes_mail.js +++ b/plugins/kolab_notes/notes_mail.js @@ -49,8 +49,7 @@ window.rcmail && rcmail.addEventListener('init', function(evt) { .attr('name', 'kolabnotesdialog') .attr('src', 'about:blank') .css('min-width', '100%') - .appendTo(document.body) - .bind('load', function(e){ + .on('load', function(e) { frame = rcmail.get_frame_window('kolabnotesinlinegui'); name = $('.notetitle', frame.rcmail.gui_objects.noteviewtitle); frame.rcmail.addEventListener('responseafteraction', refresh_mailview); @@ -111,7 +110,7 @@ window.rcmail && rcmail.addEventListener('init', function(evt) { $dialog.parent().find('.ui-dialog-buttonset .ui-button').prop('disabled', true).first().addClass('mainaction'); }, close: function() { - $dialog.dialog('destroy').remove(); + $dialog.dialog('destroy'); rcmail.removeEventListener('kolab_notes_render', dialog_render); }, buttons: buttons,