From 221c081fb83069b0c9acde7d1717833c798b9432 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 4 Aug 2011 12:08:58 +0200 Subject: [PATCH] Optimization: speedup jquery UI dialog opening on IE6 by disabling mouse/keyboard events and adding other quirks --- plugins/calendar/calendar_ui.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js index aa4e0b37..9d4abcfe 100644 --- a/plugins/calendar/calendar_ui.js +++ b/plugins/calendar/calendar_ui.js @@ -324,7 +324,8 @@ function rcube_calendar_ui(settings) // open jquery UI dialog $dialog.dialog({ modal: false, - resizable: true, + resizable: !bw.ie6, + closeOnEscape: !bw.ie6, title: null, close: function() { $dialog.dialog('destroy').hide(); @@ -350,7 +351,7 @@ function rcube_calendar_ui(settings) // close show dialog first $("#eventshow").dialog('close'); - var $dialog = $("#eventedit"); + var $dialog = $('
'); var calendar = event.calendar && me.calendars[event.calendar] ? me.calendars[event.calendar] : { editable:action=='new' }; me.selected_event = $.extend($.extend({}, event_defaults), event); // clone event object (with defaults) event = me.selected_event; // change reference to clone @@ -636,14 +637,17 @@ function rcube_calendar_ui(settings) // activate the first tab $('#eventtabs').tabs('select', 0); + var editform = $("#eventedit"); + // open jquery UI dialog $dialog.dialog({ modal: true, - resizable: true, + resizable: !bw.ie6, closeOnEscape: false, title: rcmail.gettext((action == 'edit' ? 'edit_event' : 'new_event'), 'calendar'), close: function() { - $dialog.dialog("destroy").hide(); + editform.hide().appendTo(document.body); + $dialog.dialog("destroy").remove(); rcmail.ksearch_blur(); rcmail.ksearch_destroy(); freebusy_data = {}; @@ -651,7 +655,10 @@ function rcube_calendar_ui(settings) buttons: buttons, minWidth: 500, width: 580 - }).show(); + }).append(editform.show()); // adding form content AFTERWARDS massively speeds up opening on IE6 + + // set dialog size according to form content + me.dialog_resize($dialog.get(0), editform.height() + (bw.ie ? 20 : 0), 530); title.select();