@@ -23,6 +23,29 @@ function isNumber(value) {
2323 return ! isNaN ( parseInt ( value , 10 ) ) ;
2424}
2525
26+ function hasScroll ( el , a ) {
27+
28+ //If overflow is hidden, the element might have extra content, but the user wants to hide it
29+ if ( $ ( el ) . css ( "overflow" ) === "hidden" ) {
30+ return false ;
31+ }
32+
33+ var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop" ,
34+ has = false ;
35+
36+ if ( el [ scroll ] > 0 ) {
37+ return true ;
38+ }
39+
40+ // TODO: determine which cases actually cause this to happen
41+ // if the element doesn't have the scroll set, see if it's possible to
42+ // set the scroll
43+ el [ scroll ] = 1 ;
44+ has = ( el [ scroll ] > 0 ) ;
45+ el [ scroll ] = 0 ;
46+ return has ;
47+ }
48+
2649$ . widget ( "ui.resizable" , $ . ui . mouse , {
2750 version : "@VERSION" ,
2851 widgetEventPrefix : "resize" ,
@@ -381,7 +404,7 @@ $.widget("ui.resizable", $.ui.mouse, {
381404
382405 pr = this . _proportionallyResizeElements ;
383406 ista = pr . length && ( / t e x t a r e a / i) . test ( pr [ 0 ] . nodeName ) ;
384- soffseth = ista && $ . ui . hasScroll ( pr [ 0 ] , "left" ) /* TODO - jump height */ ? 0 : that . sizeDiff . height ;
407+ soffseth = ista && hasScroll ( pr [ 0 ] , "left" ) /* TODO - jump height */ ? 0 : that . sizeDiff . height ;
385408 soffsetw = ista ? 0 : that . sizeDiff . width ;
386409
387410 s = { width : ( that . helper . width ( ) - soffsetw ) , height : ( that . helper . height ( ) - soffseth ) } ;
@@ -655,7 +678,7 @@ $.ui.plugin.add("resizable", "animate", {
655678 o = that . options ,
656679 pr = that . _proportionallyResizeElements ,
657680 ista = pr . length && ( / t e x t a r e a / i) . test ( pr [ 0 ] . nodeName ) ,
658- soffseth = ista && $ . ui . hasScroll ( pr [ 0 ] , "left" ) /* TODO - jump height */ ? 0 : that . sizeDiff . height ,
681+ soffseth = ista && hasScroll ( pr [ 0 ] , "left" ) /* TODO - jump height */ ? 0 : that . sizeDiff . height ,
659682 soffsetw = ista ? 0 : that . sizeDiff . width ,
660683 style = { width : ( that . size . width - soffsetw ) , height : ( that . size . height - soffseth ) } ,
661684 left = ( parseInt ( that . element . css ( "left" ) , 10 ) + ( that . position . left - that . originalPosition . left ) ) || null ,
@@ -728,8 +751,8 @@ $.ui.plugin.add("resizable", "containment", {
728751 co = that . containerOffset ;
729752 ch = that . containerSize . height ;
730753 cw = that . containerSize . width ;
731- width = ( $ . ui . hasScroll ( ce , "left" ) ? ce . scrollWidth : cw ) ;
732- height = ( $ . ui . hasScroll ( ce ) ? ce . scrollHeight : ch ) ;
754+ width = ( hasScroll ( ce , "left" ) ? ce . scrollWidth : cw ) ;
755+ height = ( hasScroll ( ce ) ? ce . scrollHeight : ch ) ;
733756
734757 that . parentData = {
735758 element : ce , left : co . left , top : co . top , width : width , height : height
0 commit comments