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 134
134
$ ( '#djShowToolBarButton' ) . on ( 'mousedown' , function ( event ) {
135
135
var startPageY = event . pageY ;
136
136
var baseY = handle . offset ( ) . top - startPageY ;
137
+ var windowHeight = $ ( window ) . height ( ) ;
137
138
$ ( document ) . on ( 'mousemove.djDebug' , function ( event ) {
138
139
// Chrome can send spurious mousemove events, so don't do anything unless the
139
140
// cursor really moved. Otherwise, it will be impossible to expand the toolbar
140
141
// due to djdt.handleDragged being set to true.
141
142
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 } ) ;
143
152
djdt . handleDragged = true ;
144
153
}
145
154
} ) ;
You can’t perform that action at this time.
0 commit comments