Commit 51f48392 authored by Riyad Preukschas's avatar Riyad Preukschas

Fix type error if there is a different location hash

parent d412abd1
...@@ -40,12 +40,12 @@ $ -> ...@@ -40,12 +40,12 @@ $ ->
# "#L12" and "#L34-56" supported # "#L12" and "#L34-56" supported
highlightBlobLines = -> highlightBlobLines = ->
if window.location.hash isnt "" if window.location.hash isnt ""
matches = window.location.hash.match /\#L(\d+)(\-(\d+))?/ matches = window.location.hash.match(/\#L(\d+)(\-(\d+))?/)
first_line = parseInt matches[1] first_line = parseInt(matches?[1])
last_line = parseInt matches[3] last_line = parseInt(matches?[3])
unless isNaN first_line unless isNaN first_line
last_line = first_line if isNaN last_line last_line = first_line if isNaN(last_line)
$("#tree-content-holder .highlight .line").removeClass("hll") $("#tree-content-holder .highlight .line").removeClass("hll")
$("#LC#{line}").addClass("hll") for line in [first_line..last_line] $("#LC#{line}").addClass("hll") for line in [first_line..last_line]
$("#L#{first_line}").ScrollTo() $("#L#{first_line}").ScrollTo()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment