Closed kamil4 closed 2 years ago
Added some fixes in https://github.com/LycheeOrg/Lychee-front/pull/317/commits/a46de8a39958fcaf28b31af8c1a03152142f6bf8:
length === 1
instead of length > 0
. I don't really know when and how this method is called, so this is more a fix for a theoretical situation. active = $(".album:hover, .album.active")
might be a sequence of items, if more than one photo or album is selected at a time ("multi-select"). While .attr
returns the attribute of the first item, the situation might lead to unexpected results due to ambiguity, if - for example - photos from different albums are selected. With length === 1
the value is always unambiguous.attr
may return undefined
if the attribute is not defined on the item, see jQuery Doc: attr(), but isID
expects ?string
. Hence, || null
takes care of that.I'm honestly not sure what purpose those selectors serve at this point.
Yes, I definitely understand that feeling. I have the same problem and my IDE is also complaining about these selectors constantly. Irrespective, of any work on a Livewire frontend I have been considering to gradually transform the JS frontend via several PRs into something which is more maintainable, more modern and more efficient than we have now. This would also involve to remove most of the CSS selectors. I am just lacking the time.
But this leads me to https://github.com/LycheeOrg/basicModal/pull/3 and https://github.com/LycheeOrg/basicModal/pull/4 which are still open. This would also be one (tiny, tiny) step into that direction.
Fixes https://github.com/LycheeOrg/Lychee/issues/1483
I'm honestly not sure what purpose those selectors serve at this point. There was a comment
Search
above them but that's definitely outdated now that the search results are inalbum.json
. I didn't want to introduce some other embarrassing last-minute bugs by removing them so I just made them more robust instead...