Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fileCounter mis-numbered when uploadQueueOrder = 'bottom' and more than 2 files added #160

Open
kpgraci opened this issue Aug 22, 2017 · 1 comment

Comments

@kpgraci
Copy link

kpgraci commented Aug 22, 2017

function updateFileCounter assumes 'top' number ordering. Fix below corrects:

    function updateFileCounter(s, obj) {
        if (s.showFileCounter) {
            var count = $(obj.container).find(".ajax-file-upload-filename").length;
            obj.fileCounter = count + 1
            if (s.uploadQueueOrder === "bottom") count = 1; //fix 
            $(obj.container).find(".ajax-file-upload-filename").each(function (i, items) {
                var arr = $(this).html().split(s.fileCounterStyle);
                var fileNum = parseInt(arr[0]) - 1; //decrement;
                var name = count + s.fileCounterStyle + arr[1];
                $(this).html(name);
                s.uploadQueueOrder === "top" ? count-- : count++; //fix
            });
        }
    }
@hayageek
Copy link
Owner

Can you send me pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants