From ebf8726eeaa507096ef28e776303b459c401a924 Mon Sep 17 00:00:00 2001 From: alecpl Date: Sat, 3 Oct 2009 19:12:27 +0000 Subject: - Added attachment upload indicator with parallel upload (#1486058) --- program/js/app.js | 59 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 52 insertions(+), 7 deletions(-) (limited to 'program/js/app.js') diff --git a/program/js/app.js b/program/js/app.js index 91d0f13b4..643664af5 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -1629,15 +1629,15 @@ function rcube_webmail() // also send search request to get the right messages if (this.env.search_request) add_url += '&_search='+this.env.search_request; - + // set page=1 if changeing to another mailbox - if (!page && this.env.mailbox != mbox) + if (!page) { page = 1; this.env.current_page = page; this.show_contentframe(false); } - + if (mbox != this.env.mailbox || (mbox == this.env.mailbox && !page && !sort)) add_url += '&_refresh=1'; @@ -2171,6 +2171,14 @@ function rcube_webmail() return false; } + // check if all files has been uploaded + if (this.gui_objects.attachmentlist) { + var list = this.gui_objects.attachmentlist.getElementsByTagName("li"); + for (i=0;i'+content; + this.add2attachment_list(ts, content); } // set reference to the form object @@ -2463,12 +2499,21 @@ function rcube_webmail() // add file name to attachment list // called from upload page - this.add2attachment_list = function(name, content) + this.add2attachment_list = function(name, content, upload_id) { if (!this.gui_objects.attachmentlist) return false; - - $('
  • ').attr('id', name).html(content).appendTo(this.gui_objects.attachmentlist); + + var indicator; + // replace indicator's li + if (upload_id && (indicator = document.getElementById(upload_id))) { + var li = document.createElement('li'); + $(li).attr('id', name).html(content); + indicator.parentNode.replaceChild(li, indicator); + } else { // add new li + $('
  • ').attr('id', name).html(content).appendTo(this.gui_objects.attachmentlist); + } + return true; }; -- cgit v1.2.3