Ticket #5658: 0001-fixes-5658-bad-positioning-for-only-child-hidden-inp.patch

File 0001-fixes-5658-bad-positioning-for-only-child-hidden-inp.patch, 1.2 KB (added by andyfowler, 12 years ago)
  • ui/jquery.ui.datepicker.js

    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, { 
    736736        /* Find an object's position on the screen. */
    737737        _findPos: function(obj) {
    738738                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
    740742        while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) {
    741             obj = obj[isRTL ? 'previousSibling' : 'nextSibling'];
     743            obj = (obj[seekMethod]) ? obj[seekMethod] : obj.parentElement;
    742744        }
    743745        var position = $(obj).offset();
    744746            return [position.left, position.top];