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

inital preview data is not appended because there is no assignment #722

Closed
koxu1996 opened this issue Jul 26, 2016 · 0 comments
Closed

inital preview data is not appended because there is no assignment #722

koxu1996 opened this issue Jul 26, 2016 · 0 comments
Labels

Comments

@koxu1996
Copy link
Contributor

Today I usedfilesortedevent and I got stack which was array of undefined. I debugged code and figured out these lines are the problem: https://github.com/kartik-v/bootstrap-fileinput/blob/master/js/fileinput.js#L1636-L1638
concat() does not change existing arrays, so new data are initialPreview, initialPreviewThumbTags, initialPreviewConfig are unmodified after upload. Simple fix and I am getting correct stack:

self.initialPreview = self.initialPreview.concat(content);
self.initialPreviewThumbTags = self.initialPreviewThumbTags.concat(tags);
self.initialPreviewConfig = self.initialPreviewConfig.concat(config);

Am I right?

@kartik-v kartik-v added the bug label Jul 26, 2016
kartik-v added a commit that referenced this issue Jul 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants