|
1234 | 1234 | } |
1235 | 1235 | }; |
1236 | 1236 | }) |
1237 | | - .controller('RamlConsoleController', |
| 1237 | + .controller('RamlConsoleController', |
1238 | 1238 | ['$attrs', '$scope', '$rootScope', '$timeout', '$window', function RamlConsoleController( |
1239 | 1239 | $attrs, $scope, $rootScope, $timeout, $window |
1240 | 1240 | ) { |
|
1246 | 1246 | $scope.disableTitle = $attrs.hasOwnProperty('disableTitle'); |
1247 | 1247 | $scope.disableTryIt = $attrs.hasOwnProperty('disableTryIt'); |
1248 | 1248 | $scope.disableDescription = $attrs.hasOwnProperty('disableDescription'); |
| 1249 | + $scope.descriptionLimit = $attrs.hasOwnProperty('descriptionLimit') || 50; |
1249 | 1250 | $scope.documentationCollapsed = $attrs.hasOwnProperty('documentationCollapsed'); |
1250 | 1251 | $scope.proxy = $window.RAML.Settings.proxy; |
1251 | 1252 | $scope.readResourceTraits = readResourceTraits; |
@@ -7155,7 +7156,14 @@ angular.module('ramlConsoleApp').run(['$templateCache', function($templateCache) |
7155 | 7156 | "\n" + |
7156 | 7157 | " <h1 ng-if=\"!disableTitle\" class=\"raml-console-title\">{{raml.title}}</h1>\n" + |
7157 | 7158 | "\n" + |
7158 | | - " <div ng-if=\"!disableDescription\" markdown=\"raml.description\"></div>\n" + |
| 7159 | + "\n" + |
| 7160 | + " <div ng-if=\"!disableDescription\" ng-init=\"actualSize = descriptionLimit\" >\n" + |
| 7161 | + " <div class=\"raml-console-root-description\" markdown=\"raml.description | limitTo : actualSize\"></div>\n" + |
| 7162 | + " <span>\n" + |
| 7163 | + " <a class=\"raml-console-show-more-less\" ng-click=\"actualSize = descriptionLimit\" ng-hide=\"raml.description.length > actualSize || raml.description.length < actualSize\">show less</a>\n" + |
| 7164 | + " <a class=\"raml-console-show-more-less\" ng-click=\"actualSize = raml.description.length\" ng-hide=\"raml.description.length == actualSize\">show more</a>\n" + |
| 7165 | + " </span>\n" + |
| 7166 | + " </div>\n" + |
7159 | 7167 | "\n" + |
7160 | 7168 | " <root-documentation></root-documentation>\n" + |
7161 | 7169 | "\n" + |
|
0 commit comments