]> source.dussan.org Git - jquery-ui.git/commitdiff
datepicker: fixes #4443: Datepicker's vertical position in thickbox. This also fixes...
authorCa-Phun Ung <pazu2k@gmail.com>
Tue, 9 Feb 2010 04:09:26 +0000 (04:09 +0000)
committerCa-Phun Ung <pazu2k@gmail.com>
Tue, 9 Feb 2010 04:09:26 +0000 (04:09 +0000)
tests/visual/datepicker/datepicker_ticket_4443.html [new file with mode: 0644]
ui/jquery.ui.datepicker.js

diff --git a/tests/visual/datepicker/datepicker_ticket_4443.html b/tests/visual/datepicker/datepicker_ticket_4443.html
new file mode 100644 (file)
index 0000000..84f08b9
--- /dev/null
@@ -0,0 +1,37 @@
+<!doctype html>
+<html lang="en">
+<head>
+       <title>Datepicker Visual Test : Datepicker ticket #4443</title>
+       <link rel="stylesheet" href="../visual.css" type="text/css" />
+       <link rel="stylesheet" href="../../../themes/base/ui.all.css" type="text/css">
+       <link rel="stylesheet" href="http://jquery.com/demo/thickbox/thickbox-code/thickbox.css" type="text/css" />
+       <script type="text/javascript" src="../../../jquery-1.4.1.js"></script>
+       <script src="http://jquery.com/demo/thickbox/thickbox-code/thickbox-compressed.js"></script>
+       <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+       <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+       <script type="text/javascript" src="../../../ui/jquery.ui.datepicker.js"></script>
+       <script type="text/javascript">
+       $(function() {
+
+         $('.datepicker').datepicker(); 
+       
+       });
+       </script>
+       <style type="text/css">
+       button { display: block; }
+       </style>
+</head>
+<body>
+
+<h1 class="ui-widget-header"><a href="http://dev.jqueryui.com/ticket/4443">#4443 - Datepicker's vertical position in thickbox is wrong</a></h1>
+
+<p><input alt="#TB_inline?height=150&width=400&inlineId=myOnPageContent" title="add a caption to title attribute / or leave blank" class="thickbox" type="button" value="Show" /></p>
+
+<div id="myOnPageContent" style="display:none">
+       <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>
+       <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>
+       <input type="text" class="datepicker" />
+</div>
+
+</body>
+</html>
index 91f863ef9798cf9f5ec22f261c2f7b717232c358..03d58681a6e4c4fc5a206dda8d3e28055c69912d 100644 (file)
@@ -725,7 +725,7 @@ $.extend(Datepicker.prototype, {
                offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
                        Math.abs(offset.left + dpWidth - viewWidth) : 0);
                offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
-                       Math.abs(offset.top + dpHeight + inputHeight * 2 - viewHeight) : 0);
+                       Math.abs(dpHeight + inputHeight) : 0);
 
                return offset;
        },