Fixed UI in console edit forms that were going over their container sometimes

SVN:trunk[4777]
This commit is contained in:
Guillaume Lajarige
2017-06-29 15:49:57 +00:00
parent cbf2919dcd
commit 495cedc04f

View File

@@ -328,6 +328,19 @@ EOF
// This selector will be reused when selecting actual tab widget A elements.
var tab_a_selector = 'ul.ui-tabs-nav a';
// This helper will be used to resize tab width
var resizeTab = function(oElem){
var tableWidth = (oElem.children('table:first').length > 0) ? oElem.children('table:first').outerWidth() : 0;
$('.wizContainer').css('min-width',
parseInt(tableWidth) +
parseInt(oElem.css('margin-left'))*2 +
parseInt(oElem.css('padding-left'))*2 +
parseInt(tabs.css('margin-left'))*2 +
parseInt(tabs.css('padding-left'))*2
)
};
// Ugly patch for a change in the behavior of jQuery UI:
// Before jQuery UI 1.9, tabs were always considered as "local" (opposed to Ajax)
@@ -352,6 +365,9 @@ EOF
event: 'change', 'show': function(event, ui) {
$('.resizable', ui.panel).resizable(); // Make resizable everything that claims to be resizable !
},
create: function( event, ui ) {
resizeTab(ui.panel);
},
beforeLoad: function( event, ui ) {
if ( ui.tab.data('loaded') && (ui.tab.attr('data-cache') == 'true')) {
event.preventDefault();
@@ -361,6 +377,9 @@ EOF
ui.jqXHR.success(function() {
ui.tab.data( "loaded", true );
});
},
activate: function( event, ui ) {
resizeTab(ui.newPanel);
}
});