Don't assign in conditionals

The assignment operator can easily be mistaken with the equality
operator when used in a condition, making the code more difficult to
read.
This commit is contained in:
Javi Martín
2019-06-30 23:57:01 +02:00
parent 86e704d8a4
commit 00d7c92e86

View File

@@ -28,7 +28,9 @@ App.TreeNavigator =
elem.removeClass("closed").addClass("open")
elem.siblings("ul").show()
if anchor = $(location).attr("hash")
anchor = $(location).attr("hash")
if anchor
elem.find("a[href='#{anchor}']").parents("ul").each ->
$(this).show()
$(this).siblings("span").removeClass("closed").addClass("open")