File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
debug_toolbar/static/debug_toolbar/js Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 134134 $ ( '#djShowToolBarButton' ) . on ( 'mousedown' , function ( event ) {
135135 var startPageY = event . pageY ;
136136 var baseY = handle . offset ( ) . top - startPageY ;
137+ var windowHeight = $ ( window ) . height ( ) ;
137138 $ ( document ) . on ( 'mousemove.djDebug' , function ( event ) {
138139 // Chrome can send spurious mousemove events, so don't do anything unless the
139140 // cursor really moved. Otherwise, it will be impossible to expand the toolbar
140141 // due to djdt.handleDragged being set to true.
141142 if ( djdt . handleDragged || event . pageY != startPageY ) {
142- handle . offset ( { top : baseY + event . pageY } ) ;
143+ var top = baseY + event . clientY ;
144+
145+ if ( top < 0 ) {
146+ top = 0 ;
147+ } else if ( top + handle . height ( ) > windowHeight ) {
148+ top = windowHeight - handle . height ( ) ;
149+ }
150+
151+ handle . css ( { top : top } ) ;
143152 djdt . handleDragged = true ;
144153 }
145154 } ) ;
You can’t perform that action at this time.
0 commit comments