Skip to content

Commit

Permalink
Fix rich content attachment refresh
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andrew-gardener committed Feb 3, 2018
1 parent b5dcc11 commit deaa240
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,9 @@ module.directive('richContent',

// needs to be compiled by dynamic
$scope.richContent = '<div mathjax hljs >'+content+'</div>';
};

var processAttachment = function() {
$scope.attachmentContent = [];
if ($scope.attachment) {
$scope.attachmentContent.push(
Expand All @@ -328,7 +330,9 @@ module.directive('richContent',
};

$scope.$watchCollection('content', processContent);
processContent()
$scope.$watchCollection('attachment', processAttachment);
processContent();
processAttachment();
}
};
}
Expand Down

0 comments on commit deaa240

Please sign in to comment.