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

Strange code fragments #758

Open
liuch opened this issue Oct 30, 2024 · 1 comment
Open

Strange code fragments #758

liuch opened this issue Oct 30, 2024 · 1 comment

Comments

@liuch
Copy link

liuch commented Oct 30, 2024

Hello,
The method Lightbox.prototype.sizeOverlay returns nothing, but here the return value is used:

this.$lightbox.find('.lb-dataContainer').fadeIn(this.options.resizeDuration, function() {
  return self.sizeOverlay();
});

It doesn't seem like a bug, but it's still probably worth correcting.

Another piece of code struck me as odd:

this.$outerContainer.on('click', function(event) {
  if ($(event.target).attr('id') === 'lightbox') {
    self.end();
  }
  return false;
});

The outerContainer element is a descendant of the lightbox element, so checking id will always return false. I don't know jQuery very well, so I could be wrong. Sorry then.

@liuch
Copy link
Author

liuch commented Oct 30, 2024

A couple other corrections:

-for (var i = 0; i < $links.length; i = ++i) {
+for (var i = 0; i < $links.length; ++i) {
-for (var j = 0; j < $links.length; j = ++j) {
+for (var j = 0; j < $links.length; ++j) {

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