Skip to content

Commit cc40ffe

Browse files
committed
Fix resourceCollapsed option
1 parent 5a441ac commit cc40ffe

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

dist/scripts/api-console.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,9 +1619,10 @@
16191619
src: '@'
16201620
},
16211621
controller: function($scope, $window, $attrs) {
1622-
$scope.proxy = $window.RAML.Settings.proxy;
1623-
$scope.disableTitle = false;
1624-
$scope.resourcesCollapsed = false;
1622+
$scope.proxy = $window.RAML.Settings.proxy;
1623+
$scope.disableTitle = false;
1624+
$scope.resourcesCollapsed = false;
1625+
$scope.documentationCollapsed = false;
16251626

16261627
if ($attrs.hasOwnProperty('singleView')) {
16271628
$scope.singleView = true;
@@ -1733,12 +1734,13 @@
17331734

17341735
for (var i = 0; i < $scope.raml.resourceGroups.length; i++) {
17351736
var resources = $scope.raml.resourceGroups[i];
1736-
$scope.resourceList.push(resources.length > 1 ? false : resources[0].description ? false : null);
1737+
var status = resources.length > 1 ? false : resources[0].description ? false : null;
1738+
$scope.resourceList.push($scope.resourcesCollapsed ? true : status);
17371739
}
17381740

17391741
if ($scope.raml.documentation) {
17401742
for (var j = 0; j < $scope.raml.documentation.length; j++) {
1741-
$scope.documentList.push(false);
1743+
$scope.documentList.push($scope.documentationCollapsed ? true : false);
17421744
}
17431745
}
17441746
});

src/app/resources/resources.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
src: '@'
1111
},
1212
controller: function($scope, $window, $attrs) {
13-
$scope.proxy = $window.RAML.Settings.proxy;
14-
$scope.disableTitle = false;
15-
$scope.resourcesCollapsed = false;
13+
$scope.proxy = $window.RAML.Settings.proxy;
14+
$scope.disableTitle = false;
15+
$scope.resourcesCollapsed = false;
16+
$scope.documentationCollapsed = false;
1617

1718
if ($attrs.hasOwnProperty('singleView')) {
1819
$scope.singleView = true;
@@ -124,12 +125,13 @@
124125

125126
for (var i = 0; i < $scope.raml.resourceGroups.length; i++) {
126127
var resources = $scope.raml.resourceGroups[i];
127-
$scope.resourceList.push(resources.length > 1 ? false : resources[0].description ? false : null);
128+
var status = resources.length > 1 ? false : resources[0].description ? false : null;
129+
$scope.resourceList.push($scope.resourcesCollapsed ? true : status);
128130
}
129131

130132
if ($scope.raml.documentation) {
131133
for (var j = 0; j < $scope.raml.documentation.length; j++) {
132-
$scope.documentList.push(false);
134+
$scope.documentList.push($scope.documentationCollapsed ? true : false);
133135
}
134136
}
135137
});

0 commit comments

Comments
 (0)