From be825be157155d93d808053f08b6894b5b46dce5 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Fri, 11 Sep 2009 20:36:34 +0000 Subject: [PATCH] - Automatic adjustment of the width and height of the ModalDlg to fit the document's size SVN:code[149] --- trunk/application/uilinkswizard.class.inc.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/trunk/application/uilinkswizard.class.inc.php b/trunk/application/uilinkswizard.class.inc.php index ff56db516d..7fdc3a5081 100644 --- a/trunk/application/uilinkswizard.class.inc.php +++ b/trunk/application/uilinkswizard.class.inc.php @@ -115,6 +115,8 @@ class UILinksWizard function(data) { $('#ModalDlg').html(data); + dlgWidth = $(document).width() - 100; + $('#ModalDlg').css('width', dlgWidth); $('#ModalDlg').jqmShow(); }, 'html' @@ -149,8 +151,13 @@ class UILinksWizard nb_rows = $('#SearchResultsToAdd table.listResults tr').length; if(nb_rows > 10) { - $('#SearchResultsToAdd table.listResults tbody').attr('height', '300px'); - $('#SearchResultsToAdd .listResults tbody').css('overflow', 'auto'); + yOffset = $('#ModalDlg').height() - $('#SearchResultsToAdd table.listResults tbody').height(); + tbodyHeight = $(document).height() - 100 - yOffset; + if ($('#ModalDlg').height() > ($(document).height() - 100)) + { + $('#SearchResultsToAdd table.listResults tbody').attr('height', tbodyHeight); + $('#SearchResultsToAdd .listResults tbody').css('overflow', 'auto'); + } } },