Merge branch 'master' of http://git.roojs.com:8081/Pman.Core
authorAlan Knowles <alan@akbkhome.com>
Fri, 29 Jul 2011 05:49:34 +0000 (13:49 +0800)
committerAlan Knowles <alan@akbkhome.com>
Fri, 29 Jul 2011 05:49:34 +0000 (13:49 +0800)
Pman.Download.js

index c3ef15a..893ea0c 100644 (file)
@@ -21,8 +21,9 @@ var t = new Pman.Download({
 * @cfg {String} method     GET or POST (default GET), POST will create a form, and post that into the hidden frame.
 * @cfg {Boolean} newWindow (optional) download to new window
 * @cfg {Function} success (optional) MAY fire on download completed (fails on attachments)..
-     
+* @cfg {Number} timeout (optional) in milliseconds before it gives up (default 30000 = 30s)
 */
+
 Pman.Download = function(cfg)
 {
  
@@ -51,7 +52,7 @@ Pman.Download = function(cfg)
         (function() {
             submit = true;
             this.csvFrame.src = cfg.url;
-            this.cleanup.defer(30000,this);
+            this.cleanup.defer(cfg.timeout || 30000,this);
         }).defer(100, this);
         
        
@@ -89,7 +90,7 @@ Pman.Download = function(cfg)
     (function() {
         submit = true;
         this.form.dom.submit();
-        this.cleanup.defer(30000,this);
+        this.cleanup.defer(cfg.timeout || 30000,this);
     }).defer(100, this);