LPology / Simple-Ajax-Uploader

Javascript file upload plugin with progress bar support. Works in all major browsers, including IE7+, Chrome, Firefox, Safari, and Opera. No dependencies - use it with or without jQuery.
995 stars 267 forks source link

OnChange doesn't trigger getQueueSize() #84

Closed nrthbound closed 9 years ago

nrthbound commented 9 years ago

Trying to hide or show a button based on the queue size and I can't use OnSubmit for it (It works when doing it this way). Any ideas?

onChange: function(filename, extension, uploadBtn) {
        if (this.getQueueSize() > 8) {
            $('.browse').hide();
        }

        if (this.getQueueSize() > 0) {
            $('.upload').removeClass('hide');
        }

        var count = 8 - this.getQueueSize();
        $('span.queue-count').text(count);

}

nrthbound commented 9 years ago

My mistake, I had return false; at the bottom. However, it still doesn't function quite the right way. If I add the first file, it doesn't trigger the onChange event, but once I add another one past it, it works just fine.