Commit 840540bc authored by Jehan Tremback's avatar Jehan Tremback

refixes

parent 313f6fa8
......@@ -382,16 +382,16 @@ class Hypothesis extends Annotator
.select('blockquote').each (d) ->
chars = 180
quote = d.message.annotation.quote.replace(/\u00a0/g, ' ') # replace  
trunc = quote.substring(0, quote.lastIndexOf(' ', 180)) + "...<a href='#' class='clickForMore'>more</a>"
trunc = quote.substring(0, quote.lastIndexOf(' ', 180)) + "...<a href='#' class='more'>more</a>"
if quote.length >= chars
d3.select(this)
.html(trunc)
.on 'click', ->
d3.event.stopPropagation()
d3.event.preventDefault()
if d3.select(d3.event.target).classed('clickForMore')
d3.select(this).html(quote + "<a href='#' class='clickForLess'>less</a>")
if d3.select(d3.event.target).classed('clickForLess')
if d3.select(d3.event.target).classed('more')
d3.select(this).html(quote + "<a href='#' class='less'>less</a>")
if d3.select(d3.event.target).classed('less')
d3.select(this).html(trunc)
else
d3.select(this).html(quote)
......
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