@@ -245,6 +245,9 @@ define(function (require, exports, module) {
245245 interval = false ,
246246 moved = false ;
247247
248+ // Don't redraw the working set for the next events
249+ _suppressSortRedraw = true ;
250+
248251 function drag ( e ) {
249252 var top = e . pageY - startPageY ;
250253
@@ -304,9 +307,6 @@ define(function (require, exports, module) {
304307 if ( ! moved && Math . abs ( top ) > 3 ) {
305308 Menus . closeAll ( ) ;
306309 moved = true ;
307-
308- // Don't redraw the working set for the next events
309- _suppressSortRedraw = true ;
310310 }
311311 }
312312
@@ -377,10 +377,10 @@ define(function (require, exports, module) {
377377 if ( addBottomShadow ) {
378378 ViewUtils . addScrollerShadow ( $openFilesContainer [ 0 ] , null , true ) ;
379379 }
380-
381- // The drag is done, so set back to the default
382- _suppressSortRedraw = false ;
383380 }
381+
382+ // The drag is done, so set back to the default
383+ _suppressSortRedraw = false ;
384384 }
385385
386386
@@ -398,16 +398,17 @@ define(function (require, exports, module) {
398398
399399 // Style the element
400400 $listItem . css ( "position" , "relative" ) . css ( "z-index" , 1 ) ;
401-
401+
402402 // Envent Handlers
403- $openFilesContainer . on ( "mousemove.workingSet" , function ( e ) {
403+ var $holder = $ ( window ) ;
404+ $holder . on ( "mousemove.workingSet" , function ( e ) {
404405 if ( hasScroll ) {
405406 scroll ( e ) ;
406407 }
407408 drag ( e ) ;
408409 } ) ;
409- $openFilesContainer . on ( "mouseup.workingSet mouseleave .workingSet" , function ( e ) {
410- $openFilesContainer . off ( "mousemove.workingSet mouseup.workingSet mouseleave .workingSet" ) ;
410+ $holder . on ( "mouseup.workingSet" , function ( e ) {
411+ $holder . off ( ".workingSet" ) ;
411412 drop ( ) ;
412413 } ) ;
413414 }
0 commit comments