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

Wrong item removed from initialPreviewConfig after rearrange and delete #779

Closed
koxu1996 opened this issue Oct 23, 2016 · 1 comment
Closed

Comments

@koxu1996
Copy link
Contributor

koxu1996 commented Oct 23, 2016

Simple reproduce:

  1. Go to: http://plugins.krajee.com/file-preview-management-demo#preview-data
  2. Switch Lighthouse.jpg with Desert.jpg
  3. Remove desert image
  4. See initialPreviewConfig by entering this in web console: JSON.stringify($('#input-pd').data('fileinput').initialPreviewConfig)
  5. Now you can see that desert image still persist and lighthouse is removed!

What cause this:
Unset function use index from html data-fileindex, but this is constant and unchanged after sorting.

Solution:
Update data-fileindex after rearrange

@koxu1996 koxu1996 changed the title Bug: unexpected initialPreviewConfig after deleting rearranged images Wrong item removed from initialPreviewConfig after rearrange and delete Oct 25, 2016
@koxu1996
Copy link
Contributor Author

@kartik-v I completly edited issue, please take a look.

kartik-v added a commit that referenced this issue Oct 31, 2016
More correct thumbnail identification post rearrange - fixes #779
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

1 participant