Improved show more feature.
This commit is contained in:
parent
fbe5d1002f
commit
4703060ff7
1 changed files with 8 additions and 3 deletions
|
@ -70,10 +70,15 @@ class Index extends App.Controller
|
||||||
article = App.TicketArticle.find(article_id)
|
article = App.TicketArticle.find(article_id)
|
||||||
|
|
||||||
# build html body
|
# build html body
|
||||||
article['html'] = window.linkify( article.body.trim() )
|
article['html'] = article.body.trim()
|
||||||
|
article['html'].replace(/\n\n/m, "\n");
|
||||||
|
article['html'] = window.linkify( article['html'] )
|
||||||
notify = "<a href=\"#\" style=\"color:blue\" class=\"show_toogle\">" + T('See more') + "</a>"
|
notify = "<a href=\"#\" style=\"color:blue\" class=\"show_toogle\">" + T('See more') + "</a>"
|
||||||
article['html'] = article['html'].replace /--/m, (match) ->
|
@article_changed = false
|
||||||
|
article['html'] = article['html'].replace /^(--|__)/m, (match) =>
|
||||||
notify + '<div class="hide">' + match
|
notify + '<div class="hide">' + match
|
||||||
|
@article_changed = true
|
||||||
|
if @article_changed
|
||||||
article['html'] = article['html'] + '</div>'
|
article['html'] = article['html'] + '</div>'
|
||||||
|
|
||||||
@articles.push article
|
@articles.push article
|
||||||
|
|
Loading…
Reference in a new issue