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

navbar list may have more than one active elements #75

Closed
gdh1995 opened this issue Mar 23, 2017 · 1 comment
Closed

navbar list may have more than one active elements #75

gdh1995 opened this issue Mar 23, 2017 · 1 comment

Comments

@gdh1995
Copy link
Contributor

gdh1995 commented Mar 23, 2017

I find a bug: .viewer-list may have more than one .viewer-active elements.

The bug is caused by https://github.com/fengyuanchen/viewerjs/blob/master/src/js/methods.js#L121 :

if (self.viewed) {
  $.removeClass(self.items[self.index], 'viewer-active');
}

Here, self.viewed is not a reliable variable to detect if there's an element matching .viewer-active, because:

Considering that an image might need too many seconds to load if an image is too large or the network situation is bad, a user will be impatient and click another nav-image before the current one gets loaded. And then this bug will occur.

I have no idea safe enough to fix it, maybe if (self.index !== index) is better.

@meteor199
Copy link

对,我也遇到过这个问题。

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