From 9e4071220a4b2e09c5d85825394c8689f66510cf Mon Sep 17 00:00:00 2001
From: Andy Fowler <[email protected]>
Date: Tue, 25 May 2010 18:38:24 -0400
Subject: [PATCH] fixes #5658 bad positioning for only-child hidden inputs
---
ui/jquery.ui.datepicker.js | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js
index ee3d79e..f844fa1 100644
a
|
b
|
$.extend(Datepicker.prototype, { |
736 | 736 | /* Find an object's position on the screen. */ |
737 | 737 | _findPos: function(obj) { |
738 | 738 | var inst = this._getInst(obj); |
739 | | var isRTL = this._get(inst, 'isRTL'); |
| 739 | var seekMethod = (this._get(inst, 'isRTL')) ? 'previousSibling' : 'nextSibling'; |
| 740 | |
| 741 | // check for nearest visible sibling, or if this is an only child, try parent |
740 | 742 | while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) { |
741 | | obj = obj[isRTL ? 'previousSibling' : 'nextSibling']; |
| 743 | obj = (obj[seekMethod]) ? obj[seekMethod] : obj.parentElement; |
742 | 744 | } |
743 | 745 | var position = $(obj).offset(); |
744 | 746 | return [position.left, position.top]; |