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

[ISSUE] When maxTargets = 1. Elfinder can't call loadThumbnails if images are more than one. #2664

Closed
ethaizone opened this issue Sep 19, 2018 · 3 comments
Assignees

Comments

@ethaizone
Copy link

ethaizone commented Sep 19, 2018

Reproduce step.

  1. Set option maxTargets be 1.
  2. Upload multiple images by drag and drop.
  3. Image uploaded success but problem is incoming. (LOL)

After that ELFinder try to refresh UI and call loadThumbnails

loadThumbnails = function(reloads) {

then request will call

elFinder/js/ui/cwd.js

Lines 1285 to 1288 in 632bc97

fm.request({
data : {cmd : 'tmb', targets : tmbs},
preventFail : true
})

but it will stop because these lines.

elFinder/js/elFinder.js

Lines 2272 to 2275 in 632bc97

if (self.maxTargets && data.targets && data.targets.length > self.maxTargets) {
syncOnFail = false;
return dfrd.reject(['errMaxTargets', self.maxTargets]);
}

after that UI have problems.

  • Can't show thumbnail.
  • Can't delete file or directory.
  • Can't create new directory.
@ethaizone
Copy link
Author

Right now I make stupid patch for use right now by add cmd != "tmb" inside if like this.

if (cmd != "tmb" && self.maxTargets && data.targets && data.targets.length > self.maxTargets) {
	syncOnFail = false;
	return dfrd.reject(['errMaxTargets', self.maxTargets]);
}

I don't think this is good solution so I create this issue.

@nao-pon nao-pon self-assigned this Sep 20, 2018
@nao-pon
Copy link
Member

nao-pon commented Sep 20, 2018

@ethaizone On the handling of maxTargets option some problems on the client side were found and I fixed it. Thanks! 👍

@ethaizone
Copy link
Author

@ethaizone On the handling of maxTargets option some problems on the client side were found and I fixed it. Thanks! 👍

Good to hear. Thx. :)

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

No branches or pull requests

2 participants