@@ -99,13 +99,16 @@ define(function (require, exports, module) {
9999 $element . prepend ( $resizer ) ;
100100
101101 $resizer . on ( "mousedown" , function ( e ) {
102- var startPosition = e [ directionProperty ] ,
102+ var $resizeCont = $ ( "<div class='resizing-container " + direction + "-resizing' />" ) ,
103+ startPosition = e [ directionProperty ] ,
103104 startSize = elementSizeFunction . apply ( $element ) ,
104105 newSize = startSize ,
105106 baseSize = 0 ,
106107 doResize = true ,
107108 isMouseDown = true ;
108-
109+
110+ $body . append ( $resizeCont ) ;
111+
109112 if ( $resizableElement !== undefined ) {
110113 $element . children ( ) . not ( ".horz-resizer, .vert-resizer, .resizable-content" ) . each ( function ( index , child ) {
111114 if ( direction === DIRECTION_HORIZONTAL ) {
@@ -117,9 +120,7 @@ define(function (require, exports, module) {
117120
118121 contentSizeFunction = direction === DIRECTION_HORIZONTAL ? $resizableElement . width : $resizableElement . height ;
119122 }
120-
121- $body . toggleClass ( direction + "-resizing" ) ;
122-
123+
123124 animationRequest = window . webkitRequestAnimationFrame ( function doRedraw ( ) {
124125 // only run this if the mouse is down so we don't constantly loop even
125126 // after we're done resizing.
@@ -143,7 +144,7 @@ define(function (require, exports, module) {
143144 animationRequest = window . webkitRequestAnimationFrame ( doRedraw ) ;
144145 } ) ;
145146
146- $mainView . on ( "mousemove" , function ( e ) {
147+ $resizeCont . on ( "mousemove" , function ( e ) {
147148 // calculate newSize adding to startSize the difference
148149 // between starting and current position, capped at minSize
149150 newSize = Math . max ( startSize + ( startPosition - e [ directionProperty ] ) , minSize ) ;
@@ -153,14 +154,14 @@ define(function (require, exports, module) {
153154 function endResize ( e ) {
154155 if ( isMouseDown ) {
155156 isMouseDown = false ;
156- $mainView . off ( "mousemove" ) ;
157- $body . toggleClass ( direction + "-resizing" ) ;
157+ $resizeCont . off ( "mousemove" ) ;
158+ $resizeCont . remove ( ) ;
158159 $element . trigger ( "panelResizeEnd" , [ elementSizeFunction . apply ( $element ) ] ) ;
159160 }
160161 }
161162
162- $mainView . one ( "mouseup" , endResize ) ;
163- $mainView . mouseleave ( endResize ) ;
163+ $resizeCont . one ( "mouseup" , endResize ) ;
164+ $resizeCont . mouseleave ( endResize ) ;
164165
165166 e . preventDefault ( ) ;
166167 } ) ;
0 commit comments