From 02fb2c2939abb687299fa4a661a8baef4c0077eb Mon Sep 17 00:00:00 2001 From: hkernbach Date: Fri, 17 Jun 2016 09:26:44 +0200 Subject: [PATCH] better handling of api documentation box size --- .../frontend/js/views/applicationDetailView.js | 15 +++++++++++++++ .../aardvark/APP/frontend/js/views/supportView.js | 12 ++++++++++-- .../APP/frontend/scss/_applicationDetailView.scss | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/views/applicationDetailView.js b/js/apps/system/_admin/aardvark/APP/frontend/js/views/applicationDetailView.js index 1b5c7bc5fa..577fc35bbc 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/views/applicationDetailView.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/views/applicationDetailView.js @@ -25,6 +25,16 @@ 'mouseleave #app-scripts': 'hideDropdown' }, + resize: function(auto) { + if (auto) { + $('.innerContent').css('height', 'auto'); + } + else { + $('.innerContent').height($('.centralRow').height() - 150); + $('#swagger iframe').height($('.centralRow').height() - 150); + } + }, + changeSubview: function(e) { _.each(this.navs, function(nav) { $(nav).removeClass('active'); @@ -38,17 +48,21 @@ }); if (e.currentTarget.id === 'service-readme') { + this.resize(true); $('#readme').show(); } else if (e.currentTarget.id === 'service-api') { + this.resize(); $('#swagger').show(); } else if (e.currentTarget.id === 'service-info') { + this.resize(true); this.render(); $('#information').show(); $('#sideinformation').show(); } else if (e.currentTarget.id === 'service-settings') { + this.resize(true); this.showConfigDialog(); $('.headerButtonBar').show(); $('#settings').show(); @@ -216,6 +230,7 @@ }, render: function(mode) { + this.resize(); this.model.fetchThumbnail(function() { var callback = function(error, db) { var self = this; diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/views/supportView.js b/js/apps/system/_admin/aardvark/APP/frontend/js/views/supportView.js index da4c803e39..bb94bcc01e 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/views/supportView.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/views/supportView.js @@ -18,8 +18,13 @@ this.$el.html(this.template.render({})); }, - resize: function() { - $('.innerContent').height($('.centralRow').height() - 170); + resize: function(auto) { + if (auto) { + $('.innerContent').css('height', 'auto'); + } + else { + $('.innerContent').height($('.centralRow').height() - 170); + } }, renderSwagger: function() { @@ -48,6 +53,9 @@ $('#swagger iframe').css('margin-top', '-13px'); self.resize(); } + else { + self.resize(true); + } $('#' + view).show(); } }); diff --git a/js/apps/system/_admin/aardvark/APP/frontend/scss/_applicationDetailView.scss b/js/apps/system/_admin/aardvark/APP/frontend/scss/_applicationDetailView.scss index 3f4bdddf0b..ae06a989e0 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/scss/_applicationDetailView.scss +++ b/js/apps/system/_admin/aardvark/APP/frontend/scss/_applicationDetailView.scss @@ -229,7 +229,7 @@ main { iframe { border: 0; border-radius: 3px; - height: 600px; + height: 100%; width: 100%; } }