plugins/kolab_files

Aleksander Machniak machniak at kolabsys.com
Mon Aug 5 14:00:27 CEST 2013


 plugins/kolab_files/kolab_files.js |   24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

New commits:
commit 9c56aec465d5979b001e06e3028bb556c59fb51f
Author: Aleksander Machniak <machniak at kolabsys.com>
Date:   Mon Aug 5 13:58:08 2013 +0200

    Refresh files list after file delete from preview window (Bug #2069)

diff --git a/plugins/kolab_files/kolab_files.js b/plugins/kolab_files/kolab_files.js
index ee6e497..dcb6318 100644
--- a/plugins/kolab_files/kolab_files.js
+++ b/plugins/kolab_files/kolab_files.js
@@ -1231,15 +1231,27 @@ function kolab_files_ui()
     if (!this.response(response))
       return;
 
+    var rco, dir, self = this;
+
     this.display_message('kolab_files.filedeletenotice', 'confirmation');
+
     if (rcmail.env.file) {
-      // @TODO: reload files list in parent window
-      window.close();
-    }
-    else {
-      this.file_list();
-      this.quota();
+      rco = rcmail.opener();
+      dir = this.file_path(rcmail.env.file);
+
+      // check if opener window contains files list, if not we can just close current window
+      if (rco && rco.file_list && (opener.file_api.env.folder == dir || !opener.file_api.env.folder))
+        self = opener.file_api;
+      else
+        window.close();
     }
+
+    // @TODO: consider list modification "in-place" instead of full reload
+    self.file_list();
+    self.quota();
+
+    if (rcmail.env.file)
+      window.close();
   };
 
   // file(s) move request




More information about the commits mailing list