Changeset 1320:e3b4f3b9169a for admin/js/jsUpload/jquery.fileupload-ui.js
- Timestamp:
- 08/09/13 16:18:50 (12 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/jsUpload/jquery.fileupload-ui.js
r1206 r1320 1 1 /* 2 * jQuery File Upload User Interface Plugin 8. 2.12 * jQuery File Upload User Interface Plugin 8.7.1 3 3 * https://github.com/blueimp/jQuery-File-Upload 4 4 * … … 20 20 'jquery', 21 21 'tmpl', 22 './jquery.fileupload-resize', 22 './jquery.fileupload-image', 23 './jquery.fileupload-audio', 24 './jquery.fileupload-video', 23 25 './jquery.fileupload-validate' 24 26 ], factory); … … 104 106 ); 105 107 }); 106 107 /*108 *109 * Activation du bouton si un fichier trouvé110 */111 var fileUploadButtonBar = that.element.find('.fileupload-buttonbar');112 fileUploadButtonBar.find('.start').prop('disabled', false);113 fileUploadButtonBar.find('.start').removeClass('disabled');114 /*115 *116 */117 108 }, 118 109 // Callback for the start of each file upload request: 119 110 send: function (e, data) { 120 $(this).find('.start').hide();121 111 var that = $(this).data('blueimp-fileupload') || 122 112 $(this).data('fileupload'); … … 140 130 // Callback for successful uploads: 141 131 done: function (e, data) { 142 143 132 var that = $(this).data('blueimp-fileupload') || 144 133 $(this).data('fileupload'), … … 151 140 data.context.each(function (index) { 152 141 var file = files[index] || 153 {error: 'Empty file upload result'} ,154 142 {error: 'Empty file upload result'}; 143 deferred = that._addFinishedDeferreds(); 155 144 that._transition($(this)).done( 156 145 function () { … … 171 160 }); 172 161 } else { 173 template = that._renderDownload(files) 174 .appendTo(that.options.filesContainer); 162 template = that._renderDownload(files)[ 163 that.options.prependFiles ? 'prependTo' : 'appendTo' 164 ](that.options.filesContainer); 175 165 that._forceReflow(template); 176 166 deferred = that._addFinishedDeferreds(); … … 227 217 }); 228 218 } else if (data.errorThrown !== 'abort') { 229 data.context = that._renderUpload(data.files) 230 .appendTo(that.options.filesContainer) 219 data.context = that._renderUpload(data.files)[ 220 that.options.prependFiles ? 'prependTo' : 'appendTo' 221 ](that.options.filesContainer) 231 222 .data('data', data); 232 223 that._forceReflow(data.context); … … 281 272 // Callback for uploads start, equivalent to the global ajaxStart event: 282 273 start: function (e) { 283 $(this).find('.start').hide();284 274 var that = $(this).data('blueimp-fileupload') || 285 $(this).data('fileupload');275 $(this).data('fileupload'); 286 276 that._resetFinishedDeferreds(); 287 277 that._transition($(this).find('.fileupload-progress')).done( 288 289 278 function () { 290 291 279 that._trigger('started', e); 292 280 } … … 295 283 // Callback for uploads stop, equivalent to the global ajaxStop event: 296 284 stop: function (e) { 297 $(this).find('.start').show();298 285 var that = $(this).data('blueimp-fileupload') || 299 286 $(this).data('fileupload'), … … 312 299 } 313 300 ); 314 /*315 * Recherche des fichers restants à uploader316 * Désactivation du bouton si plus rien317 */318 var filesList = that.options.filesContainer;319 if(filesList.find('.start').size() == 0) {320 var fileUploadButtonBar = that.element.find('.fileupload-buttonbar');321 fileUploadButtonBar.find('.start').prop('disabled', true);322 fileUploadButtonBar.find('.start').addClass('disabled');323 }324 /*325 *326 */327 301 }, 328 302 processstart: function () { … … 335 309 destroy: function (e, data) { 336 310 var that = $(this).data('blueimp-fileupload') || 337 $(this).data('fileupload'); 338 if (data.url) { 339 $.ajax(data).done(function () { 311 $(this).data('fileupload'), 312 removeNode = function () { 340 313 that._transition(data.context).done( 341 314 function () { … … 344 317 } 345 318 ); 346 }); 319 }; 320 if (data.url) { 321 $.ajax(data).done(removeNode); 322 } else { 323 removeNode(); 347 324 } 348 325 } … … 637 614 this._super(); 638 615 this._resetFinishedDeferreds(); 616 if (!$.support.fileInput) { 617 this._disableFileInputButton(); 618 } 639 619 }, 640 620
Note: See TracChangeset
for help on using the changeset viewer.