Ticket #3692: 3692_2.patch

File 3692_2.patch, 895 bytes (added by Garry Yao, 10 years ago)
  • _source/core/dom/element.js

     
    11971197                        // Append the offsets for the entire element hierarchy.
    11981198                        var elementPosition = this.getDocumentPosition();
    11991199                        offset += elementPosition.y;
    1200 
    12011200                        // Scroll the window to the desired position, if not already visible.
    12021201                        var currentScroll = win.getScrollPosition().y;
    1203                         if ( offset > 0 && ( offset > currentScroll || offset < currentScroll - winHeight ) )
    1204                                 win.$.scrollTo( 0, offset );
     1202
     1203                        // Though the computed offset value maybe out of range ( e.g.
     1204                        // a negative value ), browser will try to scroll as much as possible. (#3692)
     1205                        win.$.scrollTo( 0, offset > 0 ? offset : 0 );
    12051206                },
    12061207
    12071208                setState : function( state )
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy