Just set highlighter if element is visible.

This commit is contained in:
Martin Edenhofer 2015-10-02 00:21:19 +02:00
parent 19a2e5f8de
commit 736feb62b6

View file

@ -46,7 +46,7 @@ class ArticleViewItem extends App.Controller
return if data.ticket_id.toString() isnt @ticket.id.toString() return if data.ticket_id.toString() isnt @ticket.id.toString()
# set highlighter # set highlighter
@highligher.loadHighlights(@ticket_article_id) @setHighlighter()
if !@shown if !@shown
@ -62,6 +62,10 @@ class ArticleViewItem extends App.Controller
release: => release: =>
App.TicketArticle.unsubscribe(@subscribeId) App.TicketArticle.unsubscribe(@subscribeId)
setHighlighter: =>
return if !@el.is(':visible')
@highligher.loadHighlights(@ticket_article_id)
hasChanged: (article) => hasChanged: (article) =>
# if no last article exists, remember it and return true # if no last article exists, remember it and return true
@ -122,11 +126,11 @@ class ArticleViewItem extends App.Controller
article: @article article: @article
) )
# set see more option # set see more
@setSeeMore() @setSeeMore()
# set highlighter # set highlighter
@highligher.loadHighlights(@ticket_article_id) @setHighlighter()
# set see more options # set see more options
setSeeMore: => setSeeMore: =>