plugins/calendar plugins/kolab_files plugins/tasklist

Aleksander Machniak machniak at kolabsys.com
Fri May 31 13:13:26 CEST 2013


 plugins/calendar/calendar_ui.js    |    7 ++-----
 plugins/kolab_files/kolab_files.js |    7 ++-----
 plugins/tasklist/tasklist.js       |    4 +---
 3 files changed, 5 insertions(+), 13 deletions(-)

New commits:
commit 671bf6eb13b1856220b6a7d5852b893942cd685d
Author: Aleksander Machniak <machniak at kolabsys.com>
Date:   Fri May 31 13:13:05 2013 +0200

    Use improved rcmail.open_window()

diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js
index 83f69e0..6bb5d78 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -205,9 +205,7 @@ function rcube_calendar_ui(settings)
 
       // open attachment in frame if it's of a supported mimetype
       if (id && att.mimetype && $.inArray(att.mimetype, settings.mimetypes)>=0) {
-        rcmail.attachment_win = window.open(rcmail.env.comm_path+'&_action=get-attachment&'+qstring+'&_frame=1', 'rcubeeventattachment');
-        if (rcmail.attachment_win) {
-          window.setTimeout(function() { rcmail.attachment_win.focus(); }, 10);
+        if (rcmail.open_window(rcmail.env.comm_path+'&_action=get-attachment&'+qstring+'&_frame=1', true, true)) {
           return;
         }
       }
@@ -1807,8 +1805,7 @@ function rcube_calendar_ui(settings)
       var date = fc.fullCalendar('getDate') || new Date();
       var range = fc.fullCalendar('option', 'listRange');
       var sections = fc.fullCalendar('option', 'listSections');
-      var printwin = window.open(rcmail.url('print', { view: view, date: date2unixtime(date), range: range, sections: sections, search: this.search_query }), "rc_print_calendars", "toolbar=no,location=yes,menubar=yes,resizable=yes,scrollbars=yes,width=800");
-      window.setTimeout(function(){ printwin.focus() }, 50);
+      rcmail.open_window(rcmail.url('print', { view: view, date: date2unixtime(date), range: range, sections: sections, search: this.search_query }), true, true);
     };
 
     // public method to bring up the new event dialog
diff --git a/plugins/kolab_files/kolab_files.js b/plugins/kolab_files/kolab_files.js
index a16f8ff..f01a477 100644
--- a/plugins/kolab_files/kolab_files.js
+++ b/plugins/kolab_files/kolab_files.js
@@ -1324,10 +1324,7 @@ function kolab_files_ui()
   // open file in new window, using file API viewer
   this.file_open = function(file, viewer)
   {
-    var href = '?' + $.param({_task: 'files', _action: 'open', file: file, viewer: viewer == 2 ? 1 : 0}),
-      win = window.open(href, rcmail.html_identifier('rcubefile'+file));
-
-    if (win)
-      setTimeout(function() { win.focus(); }, 10);
+    var href = '?' + $.param({_task: 'files', _action: 'open', file: file, viewer: viewer == 2 ? 1 : 0});
+    rcmail.open_window(href, false, true);
   };
 };
diff --git a/plugins/tasklist/tasklist.js b/plugins/tasklist/tasklist.js
index 530bb25..f24421f 100644
--- a/plugins/tasklist/tasklist.js
+++ b/plugins/tasklist/tasklist.js
@@ -1163,9 +1163,7 @@ function rcube_tasklist_ui(settings)
         // open attachment in frame if it's of a supported mimetype
         // similar as in app.js and calendar_ui.js
         if (att.id && att.mimetype && $.inArray(att.mimetype, settings.mimetypes)>=0) {
-            rcmail.attachment_win = window.open(rcmail.env.comm_path+'&_action=get-attachment&'+qstring+'&_frame=1', 'rcubetaskattachment');
-            if (rcmail.attachment_win) {
-                window.setTimeout(function() { rcmail.attachment_win.focus(); }, 10);
+            if (rcmail.open_window(rcmail.env.comm_path+'&_action=get-attachment&'+qstring+'&_frame=1', true, true)) {
                 return;
             }
         }





More information about the commits mailing list