public/skyline/javascripts/src/library_uploader.js in skylinecms-3.0.8 vs public/skyline/javascripts/src/library_uploader.js in skylinecms-3.1.0

- old
+ new

@@ -18,11 +18,11 @@ this.uploadProgress = new Application.UploadProgress(this,pEl); var options = options || {}; options.target = this.uploadBrowser.browseEl; options.url = this.formEl.action; - options.fileClass= Application.UploadFile; + options.fileClass = Application.UploadFile; this.addEvents({ "load" : this.onInit, "updateStatus" : this.onUpdateStatus, "start" : this.onStartUpload, @@ -33,12 +33,22 @@ "fileComplete" : this.onUpdateProgress, "fileProgress" : this.onUpdateProgress }); this.parent(options); }, + + // Reset the uploader to beginstate. + reset : function(){ + this.onInit(); + this.remove(); + }, + // Events onInit : function(){ + this.uploadBrowser.browseEl.setStyle("visibility","visible"); + this.uploadBrowser.uploadEl.setStyle("visibility","visible"); + this.box.setStyle("visibility","visible"); this.uploadBrowser.show(); this.uploadProgress.hide(); }, onUpdateStatus : function(){ this.uploadBrowser.update(); @@ -49,11 +59,11 @@ this.uploadProgress.start(); }, onCompleteUpload : function(){ this.uploadBrowser.show(); this.uploadProgress.hide(); - this.uploadBrowser.browseEl.destroy(); - this.box.destroy(); + this.uploadBrowser.browseEl.setStyle("visibility","hidden"); + this.box.setStyle("visibility","hidden"); }, onCompleteSuccess : function(){ this.uploadBrowser.setMessage(this.options.allUploadedMessage); }, onCompleteFailure : function(){ \ No newline at end of file