directives: add optional placeholder for markdown

This commit is contained in:
Jimmy Zelinskie 2015-02-23 16:43:59 -05:00
parent d6af389f21
commit 498d0af6a4
3 changed files with 13 additions and 6 deletions

View file

@ -10,12 +10,14 @@ angular.module('quay').directive('markdownView', function () {
restrict: 'C',
scope: {
'content': '=content',
'firstLineOnly': '=firstLineOnly'
'firstLineOnly': '=firstLineOnly',
'placeholderNeeded': '=placeholderNeeded'
},
controller: function($scope, $element, $sce, UtilService) {
$scope.getMarkedDown = function(content, firstLineOnly) {
if (firstLineOnly) {
return $sce.trustAsHtml(UtilService.getFirstMarkdownLineAsText(content));
console.log($scope.placeholderNeeded);
return $sce.trustAsHtml(UtilService.getFirstMarkdownLineAsText(content, $scope.placeholderNeeded));
}
return $sce.trustAsHtml(UtilService.getMarkedDown(content));
};