This repository was archived by the owner on Sep 11, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 99 addonName = 'Images' , // first char is uppercase
1010 defaults = {
1111 label : '<span class="fa fa-camera"></span>' ,
12+ deleteMethod : 'POST' ,
1213 deleteScript : 'delete.php' ,
1314 preview : true ,
1415 captions : true ,
521522
522523 Images . prototype . deleteFile = function ( file ) {
523524 if ( this . options . deleteScript ) {
524- $ . post ( this . options . deleteScript , { file : file } ) ;
525+ // If deleteMethod is somehow undefined, defaults to POST
526+ var method = this . options . deleteMethod || 'POST' ;
527+
528+ $ . ajax ( {
529+ url : this . options . deleteScript ,
530+ type : method ,
531+ data : { file : file }
532+ } ) ;
525533 }
526534 } ;
527535
Original file line number Diff line number Diff line change @@ -313,9 +313,9 @@ asyncTest('deleting file', function () {
313313 . append ( '<figure><img src="image1.jpg" alt=""></figure>' +
314314 '<figure><img src="image2.jpg" alt="" class="medium-insert-image-active"></figure>' ) ;
315315
316- this . stub ( jQuery , 'post ' , function ( ) {
316+ this . stub ( jQuery , 'ajax ' , function ( ) {
317317 ok ( 1 , 'ajax call created' ) ;
318- jQuery . post . restore ( ) ;
318+ jQuery . ajax . restore ( ) ;
319319 start ( ) ;
320320 } ) ;
321321
@@ -525,4 +525,4 @@ asyncTest('file size validation', function () {
525525 files: [{ type: 'image/jpeg', size: 1001 }]
526526 });
527527});
528- */
528+ */
You can’t perform that action at this time.
0 commit comments