javascriptajaxfileuploadjsajaxfileuploader

JSAjaxFileUploader show image after upload


I am using JSAjaxFileUploader but cant find any option to show the thumbnail after file uploaded as it automatically slide out.

There is no option for this in documentation either.


Solution

  • Since there is no such functionality in plugin we will have to edit the core plugin file.

    In JSAjaxFileUploader.js file find this line:

    $eml.slideUp(settings.closeAnimationSpeed,function(){$eml.remove();});
    

    Remove this line and instead add the following:

    $('.JSOprIcons img[title="Stop Upload"]', $eml).remove();
    $('.JSpercent', $eml).html('Uploaded');
    $('.JSProgressBarParent', $eml).remove();
    var thisFileSize = $('.JSsize', $eml).html();
    var thisFileSizeShort = thisFileSize.substr(0, thisFileSize.indexOf('/'));
    $('.JSsize', $eml).html(thisFileSizeShort);
    

    I have multiple files option set to default, so i will add this code as well:

    $('form ul.JSpreveiw li:not(:last-child)').slideUp(settings.closeAnimationSpeed,function(){$('form ul.JSpreveiw li:not(:last-child)').remove()});
    

    But if you have multiple files set to more then 1 then change this code accordingly.