From a1c4c5198573a1c29f072d8e6ebd18f1546c3189 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Thu, 27 Apr 2017 12:26:27 +0200 Subject: [PATCH] Article View - remeasure see-more when images got loaded, see #950 - add top-margin to attachments --- .../app/controllers/ticket_zoom/article_view.coffee | 8 ++++++++ app/assets/stylesheets/zammad.scss | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom/article_view.coffee b/app/assets/javascripts/app/controllers/ticket_zoom/article_view.coffee index 3d7e15a54..d66ed3c15 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/article_view.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/article_view.coffee @@ -73,6 +73,7 @@ class ArticleViewItem extends App.ObserverController elements: '.textBubble-content': 'textBubbleContent' + '.textBubble-content img': 'textBubbleImages' '.textBubble-overflowContainer': 'textBubbleOverflowContainer' events: @@ -209,6 +210,13 @@ class ArticleViewItem extends App.ObserverController return if @shown @shown = true + @textBubbleImages.each (i, el) => + if !el.complete + $(el).one 'load', @measureSeeMore + + @measureSeeMore() + + measureSeeMore: => maxHeight = 560 minHeight = 90 bubbleContent = @textBubbleContent diff --git a/app/assets/stylesheets/zammad.scss b/app/assets/stylesheets/zammad.scss index d9c25e461..9dacadfea 100644 --- a/app/assets/stylesheets/zammad.scss +++ b/app/assets/stylesheets/zammad.scss @@ -4763,7 +4763,7 @@ footer { .attachments.attachments--list:not(:empty) { border-top: 1px solid rgba(0,0,0,.04); white-space: normal; - margin: 0 -20px; + margin: 10px -20px 0; padding: 26px 20px 7px 72px; position: relative; }