Browse Source

N°380 Fixed UI in console, object details that were going over their container sometimes

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4796 a333f486-631f-4898-b8df-5754b55c2be0
glajarige 8 years ago
parent
commit
cf8874d904
1 changed files with 13 additions and 10 deletions
  1. 13 10
      application/itopwebpage.class.inc.php

+ 13 - 10
application/itopwebpage.class.inc.php

@@ -332,10 +332,12 @@ EOF
 		// This helper will be used to resize tab width
 		// This helper will be used to resize tab width
 		var resizeTab = function(oElem){
 		var resizeTab = function(oElem){
 		    var iTableWidth = (oElem.children('table:first').length > 0) ? oElem.children('table:first').outerWidth() : 0;
 		    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
 		    // Resizing wizard container
-		    oWizContainerElem.css('min-width', 
+		    oContainerElem.css('min-width', 
                 parseInt(iTableWidth) +
                 parseInt(iTableWidth) +
                 parseInt(oElem.css('margin-left'))*2 +
                 parseInt(oElem.css('margin-left'))*2 +
                 parseInt(oElem.css('padding-left'))*2 +
                 parseInt(oElem.css('padding-left'))*2 +
@@ -343,12 +345,13 @@ EOF
                 parseInt(tabs.css('padding-left'))*2
                 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:
 		// Ugly patch for a change in the behavior of jQuery UI:
@@ -374,7 +377,7 @@ EOF
 			event: 'change', 'show': function(event, ui) {
 			event: 'change', 'show': function(event, ui) {
 				$('.resizable', ui.panel).resizable(); // Make resizable everything that claims to be resizable !
 				$('.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);
 			    resizeTab(ui.panel);
 			},
 			},
 			beforeLoad: function( event, ui ) {
 			beforeLoad: function( event, ui ) {
@@ -387,7 +390,7 @@ EOF
 					ui.tab.data( "loaded", true );
 					ui.tab.data( "loaded", true );
 				});
 				});
 			},
 			},
-			activate: function( event, ui ) {
+			activate: function( event, ui ) {console.log(ui);
 			    resizeTab(ui.newPanel);
 			    resizeTab(ui.newPanel);
 			}
 			}
 		});
 		});