Skip to content

Commit 882ee79

Browse files
committed
Fix IE11 rendeing issues won W7
1 parent 28e3c84 commit 882ee79

File tree

6 files changed

+79
-64
lines changed

6 files changed

+79
-64
lines changed

dist/scripts/api-console.js

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@
16721672
$window.RAML.Settings.disableProxy = status;
16731673
};
16741674

1675-
$scope.toggle = function ($event) {
1675+
$scope.toggle = function ($event, index) {
16761676
var $this = jQuery($event.currentTarget);
16771677
var $section = $this
16781678
.closest('.raml-console-resource-list-item')
@@ -1688,10 +1688,21 @@
16881688
});
16891689
}
16901690

1691+
$scope.items[index] = !$scope.items[index];
1692+
1693+
var itemsStatus = $scope.items.filter(function (el) { return el === false}).length === $scope.items.length;
1694+
1695+
$scope.collapsed = checkItemStatus(false) ? true : $scope.collapsed;
1696+
$scope.collapsed = checkItemStatus(true) ? false : $scope.collapsed;
1697+
16911698
$section.toggleClass('raml-console-is-collapsed');
16921699
$this.toggleClass('raml-console-is-active');
16931700
};
16941701

1702+
function checkItemStatus(status) {
1703+
return $scope.items.filter(function (el) { return el === status || el === null}).length === $scope.items.length
1704+
}
1705+
16951706
$scope.showResourceDescription = function ($event) {
16961707
var $this = jQuery($event.currentTarget);
16971708
var $container = $this.closest('.raml-console-resource-list-item');
@@ -1727,24 +1738,29 @@
17271738

17281739
if ($this.hasClass('raml-console-resources-expanded')) {
17291740
$scope.collapsed = true;
1741+
setCollapsed(true);
17301742
$this.text('expand all');
17311743
$this.removeClass('raml-console-resources-expanded');
17321744
jQuery('#raml-console-resources-container').find('ol.raml-console-resource-list').velocity('slideUp', {
17331745
duration: 200
17341746
});
17351747
} else {
17361748
$scope.collapsed = false;
1749+
setCollapsed(false);
17371750
$this.text('collapse all');
17381751
$this.addClass('raml-console-resources-expanded');
17391752
jQuery('#raml-console-resources-container').find('ol.raml-console-resource-list').velocity('slideDown', {
17401753
duration: 200
17411754
});
17421755
}
1743-
1744-
// jQuery('#raml-console-resources-container').find('.raml-console-resource-list-item ol.raml-console-resource-list').toggleClass('raml-console-is-collapsed');
1745-
// jQuery('#raml-console-resources-container').find('button.raml-console-resource-root-toggle').toggleClass('raml-console-is-active');
17461756
};
17471757

1758+
function setCollapsed (status) {
1759+
for (var i = 0; i < $scope.items.length; i++) {
1760+
$scope.items[i] = $scope.items[i] !== null ? !status : $scope.items[i];
1761+
}
1762+
}
1763+
17481764
$scope.hasResourcesWithChilds = function () {
17491765
return $scope.raml.resourceGroups.filter(function (el) {
17501766
return el.length > 1;
@@ -1756,6 +1772,11 @@
17561772
$scope.raml = RAML.Inspector.create(raml);
17571773
$scope.rawRaml = raml;
17581774
$scope.loaded = true;
1775+
$scope.items = [];
1776+
1777+
for (var i = 0 ; i < $scope.raml.resourceGroups.length; i++) {
1778+
$scope.items.push($scope.raml.resourceGroups[i].length > 1 ? true : null);
1779+
};
17591780
});
17601781
}
17611782
};
@@ -5627,7 +5648,7 @@ angular.module('ramlConsoleApp').run(['$templateCache', function($templateCache)
56275648
" <li id=\"{{generateId(resource.pathSegments)}}\" class=\"raml-console-resource-list-item\" ng-repeat=\"resourceGroup in raml.resourceGroups\">\n" +
56285649
" <header class=\"raml-console-resource raml-console-resource-root raml-console-clearfix\" ng-class=\"{ 'raml-console-is-active':showPanel }\" ng-init=\"resource = resourceGroup[0]\">\n" +
56295650
" <div class=\"raml-console-resource-path-container\">\n" +
5630-
" <button class=\"raml-console-resource-root-toggle\" ng-class=\"{'raml-console-is-active': collapsed}\" ng-if=\"resourceGroup.length > 1\" ng-click=\"toggle($event)\"></button>\n" +
5651+
" <button class=\"raml-console-resource-root-toggle\" ng-class=\"{'raml-console-is-active': collapsed}\" ng-if=\"resourceGroup.length > 1\" ng-click=\"toggle($event, $index)\"></button>\n" +
56315652
"\n" +
56325653
" <h2 class=\"raml-console-resource-heading raml-console-resource-heading-large\">\n" +
56335654
" <a class=\"raml-console-resource-path-active\" ng-class=\"{'raml-console-resource-heading-hover':resourceGroup.length > 1}\" ng-repeat='segment in resource.pathSegments' ng-if=\"resourceGroup.length > 1\" ng-click=\"toggleInverted($event)\">{{segment.toString()}}</a>\n" +

dist/styles/api-console-dark-theme.css

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,8 +1520,7 @@ th {
15201520
-ms-transform: perspective(45px) rotateX(30deg);
15211521
width: 108px;
15221522
position: absolute;
1523-
margin-left: -40px;
1524-
margin-left: 10px\9;
1523+
right: 0;
15251524
z-index: -1;
15261525
top: 0px;
15271526
}
@@ -1537,8 +1536,7 @@ th {
15371536
-ms-transform: perspective(45px) rotateX(30deg);
15381537
width: 108px;
15391538
position: absolute;
1540-
margin-left: -40px;
1541-
margin-left: 10px\9;
1539+
right: 0;
15421540
z-index: -1;
15431541
top: 0px;
15441542
}
@@ -1554,8 +1552,7 @@ th {
15541552
-ms-transform: perspective(45px) rotateX(30deg);
15551553
width: 108px;
15561554
position: absolute;
1557-
margin-left: -28px;
1558-
margin-left: 8px\9;
1555+
right: 0;
15591556
z-index: -1;
15601557
top: 0px;
15611558
}
@@ -1571,8 +1568,7 @@ th {
15711568
-ms-transform: perspective(45px) rotateX(30deg);
15721569
width: 108px;
15731570
position: absolute;
1574-
margin-left: -36px;
1575-
margin-left: 8px\9;
1571+
right: 0;
15761572
z-index: -1;
15771573
top: 0px;
15781574
}
@@ -1588,8 +1584,7 @@ th {
15881584
-ms-transform: perspective(45px) rotateX(30deg);
15891585
width: 108px;
15901586
position: absolute;
1591-
margin-left: -32px;
1592-
margin-left: 9px\9;
1587+
right: 0;
15931588
z-index: -1;
15941589
top: 0px;
15951590
}
@@ -1605,8 +1600,7 @@ th {
16051600
-ms-transform: perspective(45px) rotateX(30deg);
16061601
width: 108px;
16071602
position: absolute;
1608-
margin-left: -19px;
1609-
margin-left: 11px\9;
1603+
right: 0;
16101604
z-index: -1;
16111605
top: 0px;
16121606
}
@@ -1622,8 +1616,7 @@ th {
16221616
-ms-transform: perspective(45px) rotateX(30deg);
16231617
width: 108px;
16241618
position: absolute;
1625-
margin-left: -34px;
1626-
margin-left: 9px\9;
1619+
right: 0;
16271620
z-index: -1;
16281621
top: 0px;
16291622
}
@@ -1639,8 +1632,7 @@ th {
16391632
-ms-transform: perspective(45px) rotateX(30deg);
16401633
width: 108px;
16411634
position: absolute;
1642-
margin-left: -21px;
1643-
margin-left: 9px\9;
1635+
right: 0;
16441636
z-index: -1;
16451637
top: 0px;
16461638
}
@@ -1656,8 +1648,7 @@ th {
16561648
-ms-transform: perspective(45px) rotateX(30deg);
16571649
width: 108px;
16581650
position: absolute;
1659-
margin-left: -31px;
1660-
margin-left: 9px\9;
1651+
right: 0;
16611652
z-index: -1;
16621653
top: 0px;
16631654
}

dist/styles/api-console-light-theme.css

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,8 +1520,7 @@ th {
15201520
-ms-transform: perspective(45px) rotateX(30deg);
15211521
width: 108px;
15221522
position: absolute;
1523-
margin-left: -40px;
1524-
margin-left: 10px\9;
1523+
right: 0;
15251524
z-index: -1;
15261525
top: 0px;
15271526
}
@@ -1537,8 +1536,7 @@ th {
15371536
-ms-transform: perspective(45px) rotateX(30deg);
15381537
width: 108px;
15391538
position: absolute;
1540-
margin-left: -40px;
1541-
margin-left: 10px\9;
1539+
right: 0;
15421540
z-index: -1;
15431541
top: 0px;
15441542
}
@@ -1554,8 +1552,7 @@ th {
15541552
-ms-transform: perspective(45px) rotateX(30deg);
15551553
width: 108px;
15561554
position: absolute;
1557-
margin-left: -28px;
1558-
margin-left: 8px\9;
1555+
right: 0;
15591556
z-index: -1;
15601557
top: 0px;
15611558
}
@@ -1571,8 +1568,7 @@ th {
15711568
-ms-transform: perspective(45px) rotateX(30deg);
15721569
width: 108px;
15731570
position: absolute;
1574-
margin-left: -36px;
1575-
margin-left: 8px\9;
1571+
right: 0;
15761572
z-index: -1;
15771573
top: 0px;
15781574
}
@@ -1588,8 +1584,7 @@ th {
15881584
-ms-transform: perspective(45px) rotateX(30deg);
15891585
width: 108px;
15901586
position: absolute;
1591-
margin-left: -32px;
1592-
margin-left: 9px\9;
1587+
right: 0;
15931588
z-index: -1;
15941589
top: 0px;
15951590
}
@@ -1605,8 +1600,7 @@ th {
16051600
-ms-transform: perspective(45px) rotateX(30deg);
16061601
width: 108px;
16071602
position: absolute;
1608-
margin-left: -19px;
1609-
margin-left: 11px\9;
1603+
right: 0;
16101604
z-index: -1;
16111605
top: 0px;
16121606
}
@@ -1622,8 +1616,7 @@ th {
16221616
-ms-transform: perspective(45px) rotateX(30deg);
16231617
width: 108px;
16241618
position: absolute;
1625-
margin-left: -34px;
1626-
margin-left: 9px\9;
1619+
right: 0;
16271620
z-index: -1;
16281621
top: 0px;
16291622
}
@@ -1639,8 +1632,7 @@ th {
16391632
-ms-transform: perspective(45px) rotateX(30deg);
16401633
width: 108px;
16411634
position: absolute;
1642-
margin-left: -21px;
1643-
margin-left: 9px\9;
1635+
right: 0;
16441636
z-index: -1;
16451637
top: 0px;
16461638
}
@@ -1656,8 +1648,7 @@ th {
16561648
-ms-transform: perspective(45px) rotateX(30deg);
16571649
width: 108px;
16581650
position: absolute;
1659-
margin-left: -31px;
1660-
margin-left: 9px\9;
1651+
right: 0;
16611652
z-index: -1;
16621653
top: 0px;
16631654
}

src/app/resources/resources.js

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
$window.RAML.Settings.disableProxy = status;
4343
};
4444

45-
$scope.toggle = function ($event) {
45+
$scope.toggle = function ($event, index) {
4646
var $this = jQuery($event.currentTarget);
4747
var $section = $this
4848
.closest('.raml-console-resource-list-item')
@@ -58,10 +58,21 @@
5858
});
5959
}
6060

61+
$scope.items[index] = !$scope.items[index];
62+
63+
var itemsStatus = $scope.items.filter(function (el) { return el === false}).length === $scope.items.length;
64+
65+
$scope.collapsed = checkItemStatus(false) ? true : $scope.collapsed;
66+
$scope.collapsed = checkItemStatus(true) ? false : $scope.collapsed;
67+
6168
$section.toggleClass('raml-console-is-collapsed');
6269
$this.toggleClass('raml-console-is-active');
6370
};
6471

72+
function checkItemStatus(status) {
73+
return $scope.items.filter(function (el) { return el === status || el === null}).length === $scope.items.length
74+
}
75+
6576
$scope.showResourceDescription = function ($event) {
6677
var $this = jQuery($event.currentTarget);
6778
var $container = $this.closest('.raml-console-resource-list-item');
@@ -97,24 +108,29 @@
97108

98109
if ($this.hasClass('raml-console-resources-expanded')) {
99110
$scope.collapsed = true;
111+
setCollapsed(true);
100112
$this.text('expand all');
101113
$this.removeClass('raml-console-resources-expanded');
102114
jQuery('#raml-console-resources-container').find('ol.raml-console-resource-list').velocity('slideUp', {
103115
duration: 200
104116
});
105117
} else {
106118
$scope.collapsed = false;
119+
setCollapsed(false);
107120
$this.text('collapse all');
108121
$this.addClass('raml-console-resources-expanded');
109122
jQuery('#raml-console-resources-container').find('ol.raml-console-resource-list').velocity('slideDown', {
110123
duration: 200
111124
});
112125
}
113-
114-
// jQuery('#raml-console-resources-container').find('.raml-console-resource-list-item ol.raml-console-resource-list').toggleClass('raml-console-is-collapsed');
115-
// jQuery('#raml-console-resources-container').find('button.raml-console-resource-root-toggle').toggleClass('raml-console-is-active');
116126
};
117127

128+
function setCollapsed (status) {
129+
for (var i = 0; i < $scope.items.length; i++) {
130+
$scope.items[i] = $scope.items[i] !== null ? !status : $scope.items[i];
131+
}
132+
}
133+
118134
$scope.hasResourcesWithChilds = function () {
119135
return $scope.raml.resourceGroups.filter(function (el) {
120136
return el.length > 1;
@@ -126,6 +142,11 @@
126142
$scope.raml = RAML.Inspector.create(raml);
127143
$scope.rawRaml = raml;
128144
$scope.loaded = true;
145+
$scope.items = [];
146+
147+
for (var i = 0 ; i < $scope.raml.resourceGroups.length; i++) {
148+
$scope.items.push($scope.raml.resourceGroups[i].length > 1 ? true : null);
149+
};
129150
});
130151
}
131152
};

src/app/resources/resources.tpl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h2 class="raml-console-resource-section-title">
4040
<li id="{{generateId(resource.pathSegments)}}" class="raml-console-resource-list-item" ng-repeat="resourceGroup in raml.resourceGroups">
4141
<header class="raml-console-resource raml-console-resource-root raml-console-clearfix" ng-class="{ 'raml-console-is-active':showPanel }" ng-init="resource = resourceGroup[0]">
4242
<div class="raml-console-resource-path-container">
43-
<button class="raml-console-resource-root-toggle" ng-class="{'raml-console-is-active': collapsed}" ng-if="resourceGroup.length > 1" ng-click="toggle($event)"></button>
43+
<button class="raml-console-resource-root-toggle" ng-class="{'raml-console-is-active': collapsed}" ng-if="resourceGroup.length > 1" ng-click="toggle($event, $index)"></button>
4444

4545
<h2 class="raml-console-resource-heading raml-console-resource-heading-large">
4646
<a class="raml-console-resource-path-active" ng-class="{'raml-console-resource-heading-hover':resourceGroup.length > 1}" ng-repeat='segment in resource.pathSegments' ng-if="resourceGroup.length > 1" ng-click="toggleInverted($event)">{{segment.toString()}}</a>

0 commit comments

Comments
 (0)