From d41604cbc5db3e9a5583f8c7903e5ff48e0ccfcc Mon Sep 17 00:00:00 2001 From: Alexandre Delaunay Date: Mon, 6 Jul 2015 10:26:21 +0000 Subject: [PATCH] work on layout; fix #5394 --- inc/ajax.class.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/inc/ajax.class.php b/inc/ajax.class.php index 54798f3d2e2..6a021f01179 100644 --- a/inc/ajax.class.php +++ b/inc/ajax.class.php @@ -290,8 +290,10 @@ static function createTabs($tabdiv_id='tabspanel', $tabdivcontent_id='tabcontent $rand = mt_rand(); if (count($tabs) > 0) { - - echo "
"; + echo "
"; + if (in_array($_SESSION['glpilayout'], array('classic', 'vsplit'))) { + $orientation = 'horizontal'; + } echo "
    "; $current = 0; $selected_tab = 0; @@ -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) {