From 3bc3b33429dc6fae25610c1752184d17fc1fae06 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 25 Aug 2014 22:43:28 +0200 Subject: [PATCH] Added init version of "show more" article attributes. Fixed "set internal". --- .../app/controllers/ticket_zoom.js.coffee | 15 +++++++++++++++ .../app/views/ticket_zoom/article_view.jst.eco | 10 ++++++---- app/assets/stylesheets/zzz.css.erb | 13 ++++++++++++- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index d63ebd71a..43db17b0f 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -582,6 +582,8 @@ class ArticleView extends App.Controller 'click [data-type=internal]': 'public_internal' 'click .show_toogle': 'show_toogle' 'click [data-type=reply]': 'reply' + 'click .more': 'more_toogle' + 'click .close-details': 'more_toogle' # 'click [data-type=reply-all]': 'replyall' constructor: -> @@ -643,6 +645,19 @@ class ArticleView extends App.Controller $(e.target).text( App.i18n.translateContent('See more') ) $(e.target).next('div').addClass('hide') + more_toogle: (e) -> + e.preventDefault() + if !$(e.target).parent().find('.article-meta.top').hasClass('hide') + $(e.target).parent().find('.more').removeClass('hide') + $(e.target).parent().find('.close-details').addClass('hide') + $(e.target).parent().find('.article-meta.top').addClass('hide') + $(e.target).parent().find('.article-meta.bottom').addClass('hide') + else + $(e.target).parent().find('.more').addClass('hide') + $(e.target).parent().find('.close-details').removeClass('hide') + $(e.target).parent().find('.article-meta.top').removeClass('hide') + $(e.target).parent().find('.article-meta.bottom').removeClass('hide') + checkIfSignatureIsNeeded: (type) => # add signature diff --git a/app/assets/javascripts/app/views/ticket_zoom/article_view.jst.eco b/app/assets/javascripts/app/views/ticket_zoom/article_view.jst.eco index e53dd4f38..fea49a315 100644 --- a/app/assets/javascripts/app/views/ticket_zoom/article_view.jst.eco +++ b/app/assets/javascripts/app/views/ticket_zoom/article_view.jst.eco @@ -1,9 +1,11 @@ <% for article in @articles: %> -
+
-