Bläddra i källkod

- Automatic adjustment of the width and height of the ModalDlg to fit the document's size

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@149 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 15 år sedan
förälder
incheckning
0df897671f
1 ändrade filer med 9 tillägg och 2 borttagningar
  1. 9 2
      application/uilinkswizard.class.inc.php

+ 9 - 2
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');
+						}
 					}
 					
 				},