[otrs-cvs] otrs/var/httpd/htdocs/js Core.UI.Dialog.js,1.36,1.37

"CVS commits notifications of OTRS.org" <[email protected]>
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/otrs/var/httpd/htdocs/js
In directory lancelot:/tmp/cvs-serv31619/var/httpd/htdocs/js

Modified Files:
	Core.UI.Dialog.js 
Log Message:
Fixed handling of small dialogs (e.g. Attachment dialog in TicketZoom).

Author: mn

Index: Core.UI.Dialog.js
===================================================================
RCS file: /home/cvs/otrs/var/httpd/htdocs/js/Core.UI.Dialog.js,v
retrieving revision 1.36
retrieving revision 1.37
diff -2 -u -d -r1.36 -r1.37
--- Core.UI.Dialog.js	17 Dec 2012 12:30:14 -0000	1.36
+++ Core.UI.Dialog.js	2 Jan 2013 12:55:12 -0000	1.37
@@ -1,5 +1,5 @@
 // --
 // Core.UI.Dialog.js - Dialogs
-// Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
+// Copyright (C) 2001-2013 OTRS AG, http://otrs.org/
 // --
 // $Id$
@@ -43,12 +43,20 @@
         // Calculation:
         // Window height
-        // - top margin of dialog twice (for top and bottom)
+        // - top margin of dialog twice (for top and bottom) - only use this for big dialog windows
         // - some static pixels for Header and Footer of dialog
         var ContentScrollHeight = 0,
             WindowHeight = $(window).height(),
             WindowScrollTop = $(window).scrollTop(),
-            DialogTopMargin = $('.Dialog:visible').offset().top;
+            DialogTopMargin = $('.Dialog:visible').offset().top,
+            DialogHeight = $('.Dialog:visible').height();
 
-        ContentScrollHeight = WindowHeight - ((DialogTopMargin - WindowScrollTop) * 2) - 100;
+        // if dialog height is more than 300px recalculate width of InnerContent to make it scrollable
+        // if dialog is smaller than 300px this is not necessary
+        if (DialogHeight > 300) {
+            ContentScrollHeight = WindowHeight - ((DialogTopMargin - WindowScrollTop) * 2) - 100;
+        }
+        else {
+            ContentScrollHeight = 200;
+        }
         $('.Dialog:visible .Content .InnerContent').css('max-height', ContentScrollHeight);
     }
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.