From deaa240374f5cf833953b3510a946f10a932b317 Mon Sep 17 00:00:00 2001 From: Andrew Gardener Date: Fri, 2 Feb 2018 13:44:15 -0800 Subject: [PATCH] Fix rich content attachment refresh The attachment part of the rich content was not updating when the only the attachment changes (not content). separated it out into two different functions with a watcher on each. --- .../static/modules/rich-content/rich-content-directive.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compair/static/modules/rich-content/rich-content-directive.js b/compair/static/modules/rich-content/rich-content-directive.js index 22bc2e7c7..7c3c64f11 100644 --- a/compair/static/modules/rich-content/rich-content-directive.js +++ b/compair/static/modules/rich-content/rich-content-directive.js @@ -318,7 +318,9 @@ module.directive('richContent', // needs to be compiled by dynamic $scope.richContent = '
'+content+'
'; + }; + var processAttachment = function() { $scope.attachmentContent = []; if ($scope.attachment) { $scope.attachmentContent.push( @@ -328,7 +330,9 @@ module.directive('richContent', }; $scope.$watchCollection('content', processContent); - processContent() + $scope.$watchCollection('attachment', processAttachment); + processContent(); + processAttachment(); } }; }