Layout: add showFullscreen parameter

refs #6729
This commit is contained in:
Thomas Gelf 2015-06-17 14:14:07 +02:00
parent 55dd3747f7
commit 2f62a4383a
4 changed files with 24 additions and 8 deletions

View File

@ -14,6 +14,7 @@ if (array_key_exists('_dev', $_GET)) {
$ie8jsfile = 'js/icinga.ie8.js';
$lang = Translator::splitLocaleCode()->language;
$isIframe = $this->layout()->isIframe;
$showFullscreen = $this->layout()->showFullscreen;
$iframeClass = $isIframe ? ' iframe' : '';
?><!DOCTYPE html>
@ -49,7 +50,7 @@ $iframeClass = $isIframe ? ' iframe' : '';
</head>
<body id="body">
<pre id="responsive-debug"></pre>
<div id="layout" class="default-layout">
<div id="layout" class="default-layout<?php if ($showFullscreen): ?> fullscreen-layout<?php endif ?>">
<?= $this->render('body.phtml') ?>
</div>
<!--[if IE 8]>

View File

@ -86,6 +86,7 @@ class ActionController extends Zend_Controller_Action
$this->handlerBrowserWindows();
$this->view->translationDomain = 'icinga';
$this->_helper->layout()->isIframe = $request->getUrl()->shift('isIframe');
$this->_helper->layout()->showFullscreen = $request->getUrl()->shift('showFullscreen');
$this->_helper->layout()->moduleName = false;
$this->view->compact = $request->getParam('view') === 'compact';

View File

@ -81,13 +81,25 @@ html {
/** Fullscreen layout **/
#layout.fullscreen-layout {
#header, #sidebar, .controls > .tabs {
#header, #sidebar {
display: none;
}
.controls > ul.tabs {
margin-top: 0;
height: 1.5em;
background-color: @colorPetrol;
font-size: 0.8em;
padding: 0.2em 0 0;
}
.controls > ul.tabs > li > a {
line-height: 1.5em;
}
#main {
left: 0;
top: 0;
top: 0 !important;
}
}

View File

@ -739,11 +739,13 @@
if ('undefined' === typeof $parent) {
$('#header').css({height: 'auto'});
$('#main').css({top: $('#header').css('height')});
$('#sidebar').css({top: $('#header').height() + 'px'});
$('#header').css({height: $('#header').height() + 'px'});
$('#inner-layout').css({top: $('#header').css('height')});
if (! $('#layout').hasClass('fullscreen-layout')) {
$('#header').css({height: 'auto'});
$('#main').css({top: $('#header').css('height')});
$('#sidebar').css({top: $('#header').height() + 'px'});
$('#header').css({height: $('#header').height() + 'px'});
$('#inner-layout').css({top: $('#header').css('height')});
}
$('.container').each(function (idx, container) {
self.fixControls($(container));
});