Try to highlight lines in log a few times before giving up
This commit is contained in:
parent
4f38faf3c2
commit
cc1026656c
|
@ -31,16 +31,24 @@ class LinesSelector
|
||||||
|
|
||||||
willDestroy: ->
|
willDestroy: ->
|
||||||
@location.setHash('')
|
@location.setHash('')
|
||||||
|
@destroyed = true
|
||||||
|
|
||||||
loadLineNumbers: (element, multiple) ->
|
loadLineNumbers: (element, multiple) ->
|
||||||
@setHashValueWithLine(element, multiple)
|
@setHashValueWithLine(element, multiple)
|
||||||
@highlightLines()
|
@highlightLines()
|
||||||
|
|
||||||
highlightLines: ->
|
highlightLines: (tries) ->
|
||||||
|
tries ||= 0
|
||||||
@removeAllHighlights()
|
@removeAllHighlights()
|
||||||
|
|
||||||
if lines = @getSelectedLines()
|
if lines = @getSelectedLines()
|
||||||
@element.find('p:visible').slice(lines.first - 1, lines.last).addClass('highlight')
|
elements = @element.find('p:visible').slice(lines.first - 1, lines.last)
|
||||||
|
if elements.length
|
||||||
|
elements.addClass('highlight')
|
||||||
|
else if tries < 4
|
||||||
|
Ember.run.later this, (-> @highlightLines(tries + 1) unless @destroyed) , 500
|
||||||
|
return
|
||||||
|
|
||||||
@scroll.tryScroll()
|
@scroll.tryScroll()
|
||||||
@unfoldLines()
|
@unfoldLines()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user