|
106 | 106 | $inactiveElements.removeClass('raml-console-is-active'); |
107 | 107 | $scope.showPanel = false; |
108 | 108 | $scope.traits = null; |
| 109 | + $scope.methodInfo = {}; |
109 | 110 | }; |
110 | 111 | } |
111 | 112 | }; |
|
393 | 394 | traitList = traitList.concat($scope.resource.traits); |
394 | 395 |
|
395 | 396 | traitList.map(function (trait) { |
396 | | - if (typeof trait === 'object') { |
| 397 | + if (trait) { |
| 398 | + if (typeof trait === 'object') { |
397 | 399 | trait = Object.keys(trait).join(', '); |
398 | | - } |
| 400 | + } |
399 | 401 |
|
400 | | - if (list.indexOf(trait) === -1) { |
401 | | - list.push(trait); |
| 402 | + if (list.indexOf(trait) === -1) { |
| 403 | + list.push(trait); |
| 404 | + } |
402 | 405 | } |
403 | 406 | }); |
404 | 407 |
|
|
496 | 499 | $scope.showPanel = false; |
497 | 500 | $inactiveElements.removeClass('raml-console-is-active'); |
498 | 501 | $scope.traits = null; |
| 502 | + $scope.methodInfo = {}; |
499 | 503 | } else { |
500 | 504 | jQuery($this).addClass('raml-console-is-active'); |
501 | 505 | jQuery($this).siblings('.raml-console-tab').removeClass('raml-console-is-active'); |
502 | 506 | $scope.traits = null; |
| 507 | + $scope.methodInfo = {}; |
503 | 508 | } |
504 | 509 | }; |
505 | 510 | } |
|
1668 | 1673 |
|
1669 | 1674 | if (traits) { |
1670 | 1675 | traits.map(function (trait) { |
1671 | | - if (typeof trait === 'object') { |
1672 | | - list.push(Object.keys(trait).join(', ')); |
1673 | | - } else { |
1674 | | - list.push(trait); |
| 1676 | + if (trait) { |
| 1677 | + if (typeof trait === 'object') { |
| 1678 | + list.push(Object.keys(trait).join(', ')); |
| 1679 | + } else { |
| 1680 | + list.push(trait); |
| 1681 | + } |
1675 | 1682 | } |
1676 | 1683 | }); |
1677 | 1684 | } |
@@ -5694,7 +5701,9 @@ angular.module('ramlConsoleApp').run(['$templateCache', function($templateCache) |
5694 | 5701 | " </h3>\n" + |
5695 | 5702 | "\n" + |
5696 | 5703 | " <resource-type></resource-type>\n" + |
5697 | | - " <span ng-if=\"traits\" class=\"raml-console-flag raml-console-resource-heading-flag raml-console-resource-trait\"><b>Traits:</b> {{traits}}</span>\n" + |
| 5704 | + " <span ng-if=\"methodInfo.is\" class=\"raml-console-flag raml-console-resource-heading-flag raml-console-resource-trait\"><b>Traits:</b> {{readTraits(methodInfo.is)}}</span>\n" + |
| 5705 | + "\n" + |
| 5706 | + " <span ng-hide=\"methodInfo.is\" ng-if=\"resource.traits\" class=\"raml-console-flag raml-console-resource-heading-flag\"><b>Traits:</b> {{readResourceTraits(resource.traits)}}</span>\n" + |
5698 | 5707 | " </div>\n" + |
5699 | 5708 | "\n" + |
5700 | 5709 | " <method-list></method-list>\n" + |
|
0 commit comments