To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Changeset 4512

Show
Ignore:
Timestamp:
01/25/12 13:09:35 (4 months ago)
Author:
tboutell
Message:

#698 only one upgrade button:

* If an error returned by the server has stopQueue => true, stop all remaining uploads

* Return stopQueue => true on a disk quota full error

* Tolerate a negative number of files in progress, don't show a don't leave the page dialog (we'd like to thoroughly debug how this happens)

* Hide all spinners when we stop the music

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/apostropheHTML5Plugin/trunk/web/fileuploader/fileuploader.js

    r4508 r4512  
    350350         
    351351        qq.attach(window, 'beforeunload', function(e){ 
    352             if (!self._filesInProgress){return;} 
     352            // Should never be <0 but I see it happening. tom@punkave.com 
     353            if (self._filesInProgress <= 0){return;} 
    353354             
    354355            var e = e || window.event; 
     
    366367    _onComplete: function(id, fileName, result){ 
    367368        this._filesInProgress--;                  
    368         if (result.error){ 
     369        if (result.error) { 
     370            if (result.stopQueue){ 
     371              this._handler.cancelAll(); 
     372            } 
    369373            this._options.showMessage(result.error); 
    370374        }              
     
    922926            this._cancel(this._queue[i]); 
    923927        } 
     928        // This shouldn't be necessary but we've seen 
     929        // the "uploads still in progress" warning 
     930        // even after cancelAll. tom@punkave.com 
     931        this._filesInProgress = 0; 
     932         
    924933        this._queue = []; 
    925934    },