Skip to content

Commit ae2fca0

Browse files
committed
Fix tabs display
1 parent 6d52d84 commit ae2fca0

File tree

5 files changed

+69
-63
lines changed

5 files changed

+69
-63
lines changed

dist/scripts/api-console.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,9 +609,12 @@
609609
param: '='
610610
},
611611
controller: function($scope) {
612-
var selectedBody = $scope.$parent.context.bodyContent.selected;
613-
var bodyContent = $scope.$parent.context.bodyContent.definitions[selectedBody];
614-
var context = $scope.$parent.context[$scope.$parent.type] || bodyContent;
612+
var bodyContent = $scope.$parent.context.bodyContent;
613+
var context = $scope.$parent.context[$scope.$parent.type];
614+
615+
if (bodyContent) {
616+
context = context || bodyContent.definitions[bodyContent.selected];
617+
}
615618

616619
Object.keys(context.plain).map(function (key) {
617620
var definition = context.plain[key].definitions[0];

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

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,7 @@ th {
14191419
}
14201420

14211421
.raml-console-tab-list {
1422-
right: 12px;
1422+
right: 9px;
14231423
position: relative;
14241424
bottom: -1px;
14251425
display: flex;
@@ -1509,9 +1509,9 @@ th {
15091509
.raml-console-tab-get::before {
15101510
background: #0B88B9;
15111511
content: '';
1512-
height: 31px;
1512+
height: 45px;
15131513
border-radius: 4px;
1514-
margin: 0 10px 0;
1514+
margin: -1px 10px 0;
15151515
-webkit-transform: perspective(45px) rotateX(30deg);
15161516
-moz-transform: perspective(45px) rotateX(30deg);
15171517
-ms-transform: perspective(45px) rotateX(30deg);
@@ -1525,9 +1525,9 @@ th {
15251525
.raml-console-tab-put::before {
15261526
background: #87538f;
15271527
content: '';
1528-
height: 31px;
1528+
height: 45px;
15291529
border-radius: 4px;
1530-
margin: 0 10px 0;
1530+
margin: -1px 10px 0;
15311531
-webkit-transform: perspective(45px) rotateX(30deg);
15321532
-moz-transform: perspective(45px) rotateX(30deg);
15331533
-ms-transform: perspective(45px) rotateX(30deg);
@@ -1541,9 +1541,9 @@ th {
15411541
.raml-console-tab-delete::before {
15421542
background: #d14956;
15431543
content: '';
1544-
height: 31px;
1544+
height: 45px;
15451545
border-radius: 4px;
1546-
margin: 0 10px 0;
1546+
margin: -1px 10px 0;
15471547
-webkit-transform: perspective(45px) rotateX(30deg);
15481548
-moz-transform: perspective(45px) rotateX(30deg);
15491549
-ms-transform: perspective(45px) rotateX(30deg);
@@ -1557,9 +1557,9 @@ th {
15571557
.raml-console-tab-post::before {
15581558
background: #1EA18D;
15591559
content: '';
1560-
height: 31px;
1560+
height: 45px;
15611561
border-radius: 4px;
1562-
margin: 0 10px 0;
1562+
margin: -1px 10px 0;
15631563
-webkit-transform: perspective(45px) rotateX(30deg);
15641564
-moz-transform: perspective(45px) rotateX(30deg);
15651565
-ms-transform: perspective(45px) rotateX(30deg);
@@ -1573,9 +1573,9 @@ th {
15731573
.raml-console-tab-patch::before {
15741574
background: #02B0E2;
15751575
content: '';
1576-
height: 31px;
1576+
height: 45px;
15771577
border-radius: 4px;
1578-
margin: 0 10px 0;
1578+
margin: -1px 10px 0;
15791579
-webkit-transform: perspective(45px) rotateX(30deg);
15801580
-moz-transform: perspective(45px) rotateX(30deg);
15811581
-ms-transform: perspective(45px) rotateX(30deg);
@@ -1589,9 +1589,9 @@ th {
15891589
.raml-console-tab-connect::before {
15901590
background: #E48F0A;
15911591
content: '';
1592-
height: 31px;
1592+
height: 45px;
15931593
border-radius: 4px;
1594-
margin: 0 10px 0;
1594+
margin: -1px 10px 0;
15951595
-webkit-transform: perspective(45px) rotateX(30deg);
15961596
-moz-transform: perspective(45px) rotateX(30deg);
15971597
-ms-transform: perspective(45px) rotateX(30deg);
@@ -1605,9 +1605,9 @@ th {
16051605
.raml-console-tab-head::before {
16061606
background: #8A45A2;
16071607
content: '';
1608-
height: 31px;
1608+
height: 45px;
16091609
border-radius: 4px;
1610-
margin: 0 10px 0;
1610+
margin: -1px 10px 0;
16111611
-webkit-transform: perspective(45px) rotateX(30deg);
16121612
-moz-transform: perspective(45px) rotateX(30deg);
16131613
-ms-transform: perspective(45px) rotateX(30deg);
@@ -1621,9 +1621,9 @@ th {
16211621
.raml-console-tab-options::before {
16221622
background: #1EBD77;
16231623
content: '';
1624-
height: 31px;
1624+
height: 45px;
16251625
border-radius: 4px;
1626-
margin: 0 10px 0;
1626+
margin: -1px 10px 0;
16271627
-webkit-transform: perspective(45px) rotateX(30deg);
16281628
-moz-transform: perspective(45px) rotateX(30deg);
16291629
-ms-transform: perspective(45px) rotateX(30deg);
@@ -1637,9 +1637,9 @@ th {
16371637
.raml-console-tab-trace::before {
16381638
background: #98B805;
16391639
content: '';
1640-
height: 31px;
1640+
height: 45px;
16411641
border-radius: 4px;
1642-
margin: 0 10px 0;
1642+
margin: -1px 10px 0;
16431643
-webkit-transform: perspective(45px) rotateX(30deg);
16441644
-moz-transform: perspective(45px) rotateX(30deg);
16451645
-ms-transform: perspective(45px) rotateX(30deg);

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

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,7 @@ th {
14191419
}
14201420

14211421
.raml-console-tab-list {
1422-
right: 12px;
1422+
right: 9px;
14231423
position: relative;
14241424
bottom: -1px;
14251425
display: flex;
@@ -1509,9 +1509,9 @@ th {
15091509
.raml-console-tab-get::before {
15101510
background: #0B88B9;
15111511
content: '';
1512-
height: 31px;
1512+
height: 45px;
15131513
border-radius: 4px;
1514-
margin: 0 10px 0;
1514+
margin: -1px 10px 0;
15151515
-webkit-transform: perspective(45px) rotateX(30deg);
15161516
-moz-transform: perspective(45px) rotateX(30deg);
15171517
-ms-transform: perspective(45px) rotateX(30deg);
@@ -1525,9 +1525,9 @@ th {
15251525
.raml-console-tab-put::before {
15261526
background: #87538f;
15271527
content: '';
1528-
height: 31px;
1528+
height: 45px;
15291529
border-radius: 4px;
1530-
margin: 0 10px 0;
1530+
margin: -1px 10px 0;
15311531
-webkit-transform: perspective(45px) rotateX(30deg);
15321532
-moz-transform: perspective(45px) rotateX(30deg);
15331533
-ms-transform: perspective(45px) rotateX(30deg);
@@ -1541,9 +1541,9 @@ th {
15411541
.raml-console-tab-delete::before {
15421542
background: #d14956;
15431543
content: '';
1544-
height: 31px;
1544+
height: 45px;
15451545
border-radius: 4px;
1546-
margin: 0 10px 0;
1546+
margin: -1px 10px 0;
15471547
-webkit-transform: perspective(45px) rotateX(30deg);
15481548
-moz-transform: perspective(45px) rotateX(30deg);
15491549
-ms-transform: perspective(45px) rotateX(30deg);
@@ -1557,9 +1557,9 @@ th {
15571557
.raml-console-tab-post::before {
15581558
background: #1EA18D;
15591559
content: '';
1560-
height: 31px;
1560+
height: 45px;
15611561
border-radius: 4px;
1562-
margin: 0 10px 0;
1562+
margin: -1px 10px 0;
15631563
-webkit-transform: perspective(45px) rotateX(30deg);
15641564
-moz-transform: perspective(45px) rotateX(30deg);
15651565
-ms-transform: perspective(45px) rotateX(30deg);
@@ -1573,9 +1573,9 @@ th {
15731573
.raml-console-tab-patch::before {
15741574
background: #02B0E2;
15751575
content: '';
1576-
height: 31px;
1576+
height: 45px;
15771577
border-radius: 4px;
1578-
margin: 0 10px 0;
1578+
margin: -1px 10px 0;
15791579
-webkit-transform: perspective(45px) rotateX(30deg);
15801580
-moz-transform: perspective(45px) rotateX(30deg);
15811581
-ms-transform: perspective(45px) rotateX(30deg);
@@ -1589,9 +1589,9 @@ th {
15891589
.raml-console-tab-connect::before {
15901590
background: #E48F0A;
15911591
content: '';
1592-
height: 31px;
1592+
height: 45px;
15931593
border-radius: 4px;
1594-
margin: 0 10px 0;
1594+
margin: -1px 10px 0;
15951595
-webkit-transform: perspective(45px) rotateX(30deg);
15961596
-moz-transform: perspective(45px) rotateX(30deg);
15971597
-ms-transform: perspective(45px) rotateX(30deg);
@@ -1605,9 +1605,9 @@ th {
16051605
.raml-console-tab-head::before {
16061606
background: #8A45A2;
16071607
content: '';
1608-
height: 31px;
1608+
height: 45px;
16091609
border-radius: 4px;
1610-
margin: 0 10px 0;
1610+
margin: -1px 10px 0;
16111611
-webkit-transform: perspective(45px) rotateX(30deg);
16121612
-moz-transform: perspective(45px) rotateX(30deg);
16131613
-ms-transform: perspective(45px) rotateX(30deg);
@@ -1621,9 +1621,9 @@ th {
16211621
.raml-console-tab-options::before {
16221622
background: #1EBD77;
16231623
content: '';
1624-
height: 31px;
1624+
height: 45px;
16251625
border-radius: 4px;
1626-
margin: 0 10px 0;
1626+
margin: -1px 10px 0;
16271627
-webkit-transform: perspective(45px) rotateX(30deg);
16281628
-moz-transform: perspective(45px) rotateX(30deg);
16291629
-ms-transform: perspective(45px) rotateX(30deg);
@@ -1637,9 +1637,9 @@ th {
16371637
.raml-console-tab-trace::before {
16381638
background: #98B805;
16391639
content: '';
1640-
height: 31px;
1640+
height: 45px;
16411641
border-radius: 4px;
1642-
margin: 0 10px 0;
1642+
margin: -1px 10px 0;
16431643
-webkit-transform: perspective(45px) rotateX(30deg);
16441644
-moz-transform: perspective(45px) rotateX(30deg);
16451645
-ms-transform: perspective(45px) rotateX(30deg);

src/app/directives/raml-field.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111
param: '='
1212
},
1313
controller: function($scope) {
14-
var selectedBody = $scope.$parent.context.bodyContent.selected;
15-
var bodyContent = $scope.$parent.context.bodyContent.definitions[selectedBody];
16-
var context = $scope.$parent.context[$scope.$parent.type] || bodyContent;
14+
var bodyContent = $scope.$parent.context.bodyContent;
15+
var context = $scope.$parent.context[$scope.$parent.type];
16+
17+
if (bodyContent) {
18+
context = context || bodyContent.definitions[bodyContent.selected];
19+
}
1720

1821
Object.keys(context.plain).map(function (key) {
1922
var definition = context.plain[key].definitions[0];

src/scss/_tab.scss

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313

1414
.tab-list {
15-
right: 12px;
15+
right: 9px;
1616
position: relative;
1717
bottom: -1px;
1818

@@ -92,9 +92,9 @@
9292
.tab-get::before {
9393
background: $color-console-tab-get;
9494
content: '';
95-
height: 31px;
95+
height: 45px;
9696
border-radius: 4px;
97-
margin: 0 10px 0;
97+
margin: -1px 10px 0;
9898
-webkit-transform: perspective(45px) rotateX(30deg);
9999
-moz-transform: perspective(45px) rotateX(30deg);
100100
-ms-transform: perspective(45px) rotateX(30deg);
@@ -108,9 +108,9 @@
108108
.tab-put::before {
109109
background: $color-console-tab-put;
110110
content: '';
111-
height: 31px;
111+
height: 45px;
112112
border-radius: 4px;
113-
margin: 0 10px 0;
113+
margin: -1px 10px 0;
114114
-webkit-transform: perspective(45px) rotateX(30deg);
115115
-moz-transform: perspective(45px) rotateX(30deg);
116116
-ms-transform: perspective(45px) rotateX(30deg);
@@ -124,9 +124,9 @@
124124
.tab-delete::before {
125125
background: $color-console-tab-delete;
126126
content: '';
127-
height: 31px;
127+
height: 45px;
128128
border-radius: 4px;
129-
margin: 0 10px 0;
129+
margin: -1px 10px 0;
130130
-webkit-transform: perspective(45px) rotateX(30deg);
131131
-moz-transform: perspective(45px) rotateX(30deg);
132132
-ms-transform: perspective(45px) rotateX(30deg);
@@ -140,9 +140,9 @@
140140
.tab-post::before {
141141
background: $color-console-tab-post;
142142
content: '';
143-
height: 31px;
143+
height: 45px;
144144
border-radius: 4px;
145-
margin: 0 10px 0;
145+
margin: -1px 10px 0;
146146
-webkit-transform: perspective(45px) rotateX(30deg);
147147
-moz-transform: perspective(45px) rotateX(30deg);
148148
-ms-transform: perspective(45px) rotateX(30deg);
@@ -156,9 +156,9 @@
156156
.tab-patch::before {
157157
background: $color-console-tab-patch;
158158
content: '';
159-
height: 31px;
159+
height: 45px;
160160
border-radius: 4px;
161-
margin: 0 10px 0;
161+
margin: -1px 10px 0;
162162
-webkit-transform: perspective(45px) rotateX(30deg);
163163
-moz-transform: perspective(45px) rotateX(30deg);
164164
-ms-transform: perspective(45px) rotateX(30deg);
@@ -172,9 +172,9 @@
172172
.tab-connect::before {
173173
background: $color-console-tab-connect;
174174
content: '';
175-
height: 31px;
175+
height: 45px;
176176
border-radius: 4px;
177-
margin: 0 10px 0;
177+
margin: -1px 10px 0;
178178
-webkit-transform: perspective(45px) rotateX(30deg);
179179
-moz-transform: perspective(45px) rotateX(30deg);
180180
-ms-transform: perspective(45px) rotateX(30deg);
@@ -188,9 +188,9 @@
188188
.tab-head::before {
189189
background: $color-console-tab-head;
190190
content: '';
191-
height: 31px;
191+
height: 45px;
192192
border-radius: 4px;
193-
margin: 0 10px 0;
193+
margin: -1px 10px 0;
194194
-webkit-transform: perspective(45px) rotateX(30deg);
195195
-moz-transform: perspective(45px) rotateX(30deg);
196196
-ms-transform: perspective(45px) rotateX(30deg);
@@ -204,9 +204,9 @@
204204
.tab-options::before {
205205
background: $color-console-tab-options;
206206
content: '';
207-
height: 31px;
207+
height: 45px;
208208
border-radius: 4px;
209-
margin: 0 10px 0;
209+
margin: -1px 10px 0;
210210
-webkit-transform: perspective(45px) rotateX(30deg);
211211
-moz-transform: perspective(45px) rotateX(30deg);
212212
-ms-transform: perspective(45px) rotateX(30deg);
@@ -220,9 +220,9 @@
220220
.tab-trace::before {
221221
background: $color-console-tab-trace;
222222
content: '';
223-
height: 31px;
223+
height: 45px;
224224
border-radius: 4px;
225-
margin: 0 10px 0;
225+
margin: -1px 10px 0;
226226
-webkit-transform: perspective(45px) rotateX(30deg);
227227
-moz-transform: perspective(45px) rotateX(30deg);
228228
-ms-transform: perspective(45px) rotateX(30deg);

0 commit comments

Comments
 (0)