Introduce link target "_right" to keep a column with tabs rightmost

I'd have liked to get it to work that in case the tab control is not in the
rightmost column a "go back" in the history is being simulated causing
the preceding leftmost column(s) to be restored and the rightmost one
set to the one containing the tab control. But the history api does not
seem to support any read operations except for the current state..

refs #6436
This commit is contained in:
Johannes Meyer 2015-01-28 14:21:06 +01:00
parent cf857c4257
commit 618ab4f4b9
4 changed files with 13 additions and 3 deletions

View File

@ -1,4 +1,4 @@
<div class="controls">
<div class="controls" data-base-target="_right">
<?= $this->tabs ?>
<h1><?= $this->escape($module->getTitle()) ?></h1>
</div>

View File

@ -1,4 +1,4 @@
<div class="controls">
<div class="controls" data-base-target="_right">
<?= $tabs; ?>
<h1><?= $this->translate('Monitoring Backends') ?></h1>
</div>

View File

@ -1,4 +1,4 @@
<div class="controls">
<div class="controls" data-base-target="_right">
<?= $this->tabs ?>
</div>
<div class="content">

View File

@ -482,6 +482,16 @@
targetId = 'col1';
$target = $('#' + targetId);
self.icinga.ui.layout1col();
} else if (targetId === '_right') {
// Ensure that the content is displayed in the rightmost column
$target = $el.closest('.container');
if ($target.attr('id') === 'col1') {
// As it's not possible to detect what's preceding the current state in the
// history stack this just simulates _main in case the respective element
// is not part of the rightmost column
$target = $('#col1');
self.icinga.ui.layout1col();
}
} else {
$target = $('#' + targetId);
}