From eeb2892205e2b7a2966ed0d290310def807f91fc Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 25 Aug 2014 23:41:58 +0200 Subject: [PATCH] Improved set internal feature, removed rerender(). --- .../app/controllers/ticket_zoom.js.coffee | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index 43db17b0f..37017c26b 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -627,12 +627,11 @@ class ArticleView extends App.Controller internal: internal ) - # runtime update - for article in @articles - if article_id is article.id - article['internal'] = internal - - @render() + # runntime update + if internal + $(e.target).closest('.article-content').find('.text-bubble').addClass('internal') + else + $(e.target).closest('.article-content').find('.text-bubble').removeClass('internal') show_toogle: (e) -> e.preventDefault() @@ -647,16 +646,16 @@ class ArticleView extends App.Controller 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') + if !$(e.target).closest('.article-content').find('.article-meta.top').hasClass('hide') + $(e.target).closest('.article-content').find('.more').removeClass('hide') + $(e.target).closest('.article-content').find('.close-details').addClass('hide') + $(e.target).closest('.article-content').find('.article-meta.top').addClass('hide') + $(e.target).closest('.article-content').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') + $(e.target).closest('.article-content').find('.more').addClass('hide') + $(e.target).closest('.article-content').find('.close-details').removeClass('hide') + $(e.target).closest('.article-content').find('.article-meta.top').removeClass('hide') + $(e.target).closest('.article-content').find('.article-meta.bottom').removeClass('hide') checkIfSignatureIsNeeded: (type) =>