Skip to content

Commit f83e915

Browse files
committed
bugs/fix-sidebar-on-fullscreen
1 parent f74faf7 commit f83e915

File tree

4 files changed

+31
-7
lines changed

4 files changed

+31
-7
lines changed

dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<link href="styles/api-console-light-theme.css" rel="stylesheet" class="theme">
88
</head>
99
<body ng-app="ramlConsoleApp" ng-cloak class="raml-console-body">
10-
<raml-initializer></raml-initializer>
10+
<raml-console single-view src="https://qa.anypoint.mulesoft.com/apiplatform/repository/public/organizations/121/apis/2951/versions/3337/files/root"></raml-console>
1111
<script src="scripts/api-console-vendor.js"></script>
1212
<script src="scripts/api-console.js"></script>
1313
<script>

dist/scripts/api-console.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,8 @@
12071207
}
12081208
};
12091209

1210+
$scope.documentationEnabled = true;
1211+
12101212
$scope.toggleSidebar = function ($event) {
12111213
var $this = jQuery($event.currentTarget);
12121214
var $panel = $this.closest('.raml-console-resource-panel');
@@ -1218,6 +1220,7 @@
12181220
}
12191221

12201222
if ($sidebar.hasClass('raml-console-is-fullscreen')) {
1223+
$scope.documentationEnabled = true;
12211224
$sidebar.velocity(
12221225
{ width: $scope.singleView ? 0 : sidebarWidth },
12231226
{
@@ -1235,9 +1238,14 @@
12351238
{ width: '100%' },
12361239
{
12371240
duration: 200,
1238-
complete: completeAnimation
1241+
complete: function (element) {
1242+
jQuery(element).removeAttr('style');
1243+
$scope.documentationEnabled = false;
1244+
apply();
1245+
}
12391246
}
12401247
);
1248+
12411249
$sidebar.addClass('raml-console-is-fullscreen');
12421250
$sidebar.addClass('raml-console-is-responsive');
12431251
$panel.addClass('raml-console-has-sidebar-fullscreen');
@@ -1270,7 +1278,11 @@
12701278
{ width: animation },
12711279
{
12721280
duration: speed,
1273-
complete: completeAnimation
1281+
complete: function (element) {
1282+
jQuery(element).removeAttr('style');
1283+
$scope.documentationEnabled = false;
1284+
apply();
1285+
}
12741286
}
12751287
);
12761288

@@ -4768,7 +4780,7 @@ angular.module('ramlConsoleApp').run(['$templateCache', function($templateCache)
47684780

47694781

47704782
$templateCache.put('directives/documentation.tpl.html',
4771-
"<div class=\"raml-console-resource-panel-primary\">\n" +
4783+
"<div class=\"raml-console-resource-panel-primary\" ng-if=\"documentationEnabled\">\n" +
47724784
" <!-- Request -->\n" +
47734785
" <header class=\"raml-console-resource-header\">\n" +
47744786
" <h3 class=\"raml-console-resource-head\">\n" +

src/app/directives/documentation.tpl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="raml-console-resource-panel-primary">
1+
<div class="raml-console-resource-panel-primary" ng-if="documentationEnabled">
22
<!-- Request -->
33
<header class="raml-console-resource-header">
44
<h3 class="raml-console-resource-head">

src/app/directives/sidebar.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@
347347
}
348348
};
349349

350+
$scope.documentationEnabled = true;
351+
350352
$scope.toggleSidebar = function ($event) {
351353
var $this = jQuery($event.currentTarget);
352354
var $panel = $this.closest('.raml-console-resource-panel');
@@ -358,6 +360,7 @@
358360
}
359361

360362
if ($sidebar.hasClass('raml-console-is-fullscreen')) {
363+
$scope.documentationEnabled = true;
361364
$sidebar.velocity(
362365
{ width: $scope.singleView ? 0 : sidebarWidth },
363366
{
@@ -375,9 +378,14 @@
375378
{ width: '100%' },
376379
{
377380
duration: 200,
378-
complete: completeAnimation
381+
complete: function (element) {
382+
jQuery(element).removeAttr('style');
383+
$scope.documentationEnabled = false;
384+
apply();
385+
}
379386
}
380387
);
388+
381389
$sidebar.addClass('raml-console-is-fullscreen');
382390
$sidebar.addClass('raml-console-is-responsive');
383391
$panel.addClass('raml-console-has-sidebar-fullscreen');
@@ -410,7 +418,11 @@
410418
{ width: animation },
411419
{
412420
duration: speed,
413-
complete: completeAnimation
421+
complete: function (element) {
422+
jQuery(element).removeAttr('style');
423+
$scope.documentationEnabled = false;
424+
apply();
425+
}
414426
}
415427
);
416428

0 commit comments

Comments
 (0)