From 3e21348193dcb25e39f67a380be5c7fd5ece828e Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 19 Sep 2013 12:49:19 +0200 Subject: [PATCH] Improved see more / fold in feature. --- .../app/controllers/ticket_zoom.js.coffee | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index 59656f6cb..83c97646c 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -606,11 +606,14 @@ class ArticleView extends App.Controller show_toogle: (e) -> e.preventDefault() - $(e.target).hide() + #$(e.target).hide() if $(e.target).next('div')[0] - $(e.target).next('div').removeClass('hide') - else - $(e.target).parent().next('div').removeClass('hide') + if $(e.target).next('div').hasClass('hide') + $(e.target).next('div').removeClass('hide') + $(e.target).text( App.i18n.translateContent('Fold in') ) + else + $(e.target).text( App.i18n.translateContent('See more') ) + $(e.target).next('div').addClass('hide') checkIfSignatureIsNeeded: (article_type) => @@ -717,7 +720,7 @@ class Article extends App.Controller @article_changed = false @article['html'] = @article['html'].replace /^-----SEEMORE-----\n/m, (match) => @article_changed = true - notify + '
' + notify + '
' if @article_changed @article['html'] = @article['html'] + '
' @@ -726,7 +729,7 @@ class Article extends App.Controller @article_changed = false @article['html'] = @article['html'].replace /^\n{0,10}(--|__)/m, (match) => @article_changed = true - notify + '
' + match + notify + '
' + match if @article_changed @article['html'] = @article['html'] + '
'