Skip to content

Commit

Permalink
work on layout; fix #5394
Browse files Browse the repository at this point in the history
  • Loading branch information
orthagh committed Jul 6, 2015
1 parent ef8a859 commit d41604c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions inc/ajax.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,10 @@ static function createTabs($tabdiv_id='tabspanel', $tabdivcontent_id='tabcontent

$rand = mt_rand();
if (count($tabs) > 0) {

echo "<div id='tabs$rand' class='center'>";
echo "<div id='tabs$rand' class='center $orientation'>";
if (in_array($_SESSION['glpilayout'], array('classic', 'vsplit'))) {
$orientation = 'horizontal';
}
echo "<ul>";
$current = 0;
$selected_tab = 0;
Expand Down Expand Up @@ -334,10 +336,16 @@ static function createTabs($tabdiv_id='tabspanel', $tabdivcontent_id='tabcontent
$.get('".$CFG_GLPI['root_doc']."/ajax/updatecurrenttab.php',
{ itemtype: '$type', id: '$ID', tab: newIndex });
}});";

if ($orientation=='vertical') {
$js .= "$('#tabs$rand').tabs().addClass( 'ui-tabs-vertical ui-helper-clearfix' );";
}
$js .= "$('#tabs$rand').removeClass( 'ui-corner-top' ).addClass( 'ui-corner-left' );";

if (in_array($_SESSION['glpilayout'], array('classic', 'vsplit'))) {
$js .= "$('#tabs$rand').scrollabletabs();";
} else {
$js .= "$('#tabs$rand').removeClass( 'ui-corner-top' ).addClass( 'ui-corner-left' );";
}

$js .= "// force reload
function reloadTab(add) {
Expand Down

0 comments on commit d41604c

Please sign in to comment.