From d80c2293dcfe5d48a7d9f4423218fcc670169383 Mon Sep 17 00:00:00 2001 From: Guillaume Lajarige Date: Tue, 4 Jul 2017 11:58:40 +0000 Subject: [PATCH] =?UTF-8?q?N=C2=B0380=20Fixed=20UI=20in=20console,=20objec?= =?UTF-8?q?t=20details=20that=20were=20going=20over=20their=20container=20?= =?UTF-8?q?sometimes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SVN:trunk[4796] --- application/itopwebpage.class.inc.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/application/itopwebpage.class.inc.php b/application/itopwebpage.class.inc.php index 595b09b79..3e9588c77 100644 --- a/application/itopwebpage.class.inc.php +++ b/application/itopwebpage.class.inc.php @@ -332,10 +332,12 @@ EOF // This helper will be used to resize tab width var resizeTab = function(oElem){ var iTableWidth = (oElem.children('table:first').length > 0) ? oElem.children('table:first').outerWidth() : 0; - var oWizContainerElem = $('.wizContainer'); + var oLayoutContentElem = oElem.closest('.ui-layout-content'); + var bEditMode = (oLayoutContentElem.find('.wizContainer').length > 0); + var oContainerElem = (bEditMode) ? oLayoutContentElem.find('.wizContainer:first') : oLayoutContentElem.find('.ui-tabs:first'); // Resizing wizard container - oWizContainerElem.css('min-width', + oContainerElem.css('min-width', parseInt(iTableWidth) + parseInt(oElem.css('margin-left'))*2 + parseInt(oElem.css('padding-left'))*2 + @@ -343,12 +345,13 @@ EOF parseInt(tabs.css('padding-left'))*2 ) - // Resizing header according to wizContainer - oWizContainerElem.parent().find('.page_header').css('min-width', - parseInt(oWizContainerElem.width()) + - parseInt(oWizContainerElem.css('margin-left'))*2 + - parseInt(oWizContainerElem.css('padding-left'))*2 - ); + // Resizing header according to content container + var iLayoutContentWidth = parseInt(oContainerElem.width()); + if(bEditMode) + { + iLayoutContentWidth += parseInt(oContainerElem.css('margin-left'))*2 + parseInt(oContainerElem.css('padding-left'))*2 + } + oLayoutContentElem.find('.page_header').css('min-width', iLayoutContentWidth); }; // Ugly patch for a change in the behavior of jQuery UI: @@ -374,7 +377,7 @@ EOF event: 'change', 'show': function(event, ui) { $('.resizable', ui.panel).resizable(); // Make resizable everything that claims to be resizable ! }, - create: function( event, ui ) { + create: function( event, ui ) {console.log(ui); resizeTab(ui.panel); }, beforeLoad: function( event, ui ) { @@ -387,7 +390,7 @@ EOF ui.tab.data( "loaded", true ); }); }, - activate: function( event, ui ) { + activate: function( event, ui ) {console.log(ui); resizeTab(ui.newPanel); } });