@@ -643,67 +643,6 @@ $.widget("ui.resizable", $.ui.mouse, {
643
643
* Resizable Extensions
644
644
*/
645
645
646
- $ . ui . plugin . add ( "resizable" , "alsoResize" , {
647
-
648
- start : function ( ) {
649
- var that = $ ( this ) . data ( "ui-resizable" ) ,
650
- o = that . options ,
651
- _store = function ( exp ) {
652
- $ ( exp ) . each ( function ( ) {
653
- var el = $ ( this ) ;
654
- el . data ( "ui-resizable-alsoresize" , {
655
- width : parseInt ( el . width ( ) , 10 ) , height : parseInt ( el . height ( ) , 10 ) ,
656
- left : parseInt ( el . css ( 'left' ) , 10 ) , top : parseInt ( el . css ( 'top' ) , 10 )
657
- } ) ;
658
- } ) ;
659
- } ;
660
-
661
- if ( typeof ( o . alsoResize ) === 'object' && ! o . alsoResize . parentNode ) {
662
- if ( o . alsoResize . length ) { o . alsoResize = o . alsoResize [ 0 ] ; _store ( o . alsoResize ) ; }
663
- else { $ . each ( o . alsoResize , function ( exp ) { _store ( exp ) ; } ) ; }
664
- } else {
665
- _store ( o . alsoResize ) ;
666
- }
667
- } ,
668
-
669
- resize : function ( event , ui ) {
670
- var that = $ ( this ) . data ( "ui-resizable" ) ,
671
- o = that . options ,
672
- os = that . originalSize ,
673
- op = that . originalPosition ,
674
- delta = {
675
- height : ( that . size . height - os . height ) || 0 , width : ( that . size . width - os . width ) || 0 ,
676
- top : ( that . position . top - op . top ) || 0 , left : ( that . position . left - op . left ) || 0
677
- } ,
678
-
679
- _alsoResize = function ( exp , c ) {
680
- $ ( exp ) . each ( function ( ) {
681
- var el = $ ( this ) , start = $ ( this ) . data ( "ui-resizable-alsoresize" ) , style = { } ,
682
- css = c && c . length ? c : el . parents ( ui . originalElement [ 0 ] ) . length ? [ 'width' , 'height' ] : [ 'width' , 'height' , 'top' , 'left' ] ;
683
-
684
- $ . each ( css , function ( i , prop ) {
685
- var sum = ( start [ prop ] || 0 ) + ( delta [ prop ] || 0 ) ;
686
- if ( sum && sum >= 0 ) {
687
- style [ prop ] = sum || null ;
688
- }
689
- } ) ;
690
-
691
- el . css ( style ) ;
692
- } ) ;
693
- } ;
694
-
695
- if ( typeof ( o . alsoResize ) === 'object' && ! o . alsoResize . nodeType ) {
696
- $ . each ( o . alsoResize , function ( exp , c ) { _alsoResize ( exp , c ) ; } ) ;
697
- } else {
698
- _alsoResize ( o . alsoResize ) ;
699
- }
700
- } ,
701
-
702
- stop : function ( ) {
703
- $ ( this ) . removeData ( "resizable-alsoresize" ) ;
704
- }
705
- } ) ;
706
-
707
646
$ . ui . plugin . add ( "resizable" , "animate" , {
708
647
709
648
stop : function ( event ) {
@@ -871,6 +810,67 @@ $.ui.plugin.add("resizable", "containment", {
871
810
}
872
811
} ) ;
873
812
813
+ $ . ui . plugin . add ( "resizable" , "alsoResize" , {
814
+
815
+ start : function ( ) {
816
+ var that = $ ( this ) . data ( "ui-resizable" ) ,
817
+ o = that . options ,
818
+ _store = function ( exp ) {
819
+ $ ( exp ) . each ( function ( ) {
820
+ var el = $ ( this ) ;
821
+ el . data ( "ui-resizable-alsoresize" , {
822
+ width : parseInt ( el . width ( ) , 10 ) , height : parseInt ( el . height ( ) , 10 ) ,
823
+ left : parseInt ( el . css ( 'left' ) , 10 ) , top : parseInt ( el . css ( 'top' ) , 10 )
824
+ } ) ;
825
+ } ) ;
826
+ } ;
827
+
828
+ if ( typeof ( o . alsoResize ) === 'object' && ! o . alsoResize . parentNode ) {
829
+ if ( o . alsoResize . length ) { o . alsoResize = o . alsoResize [ 0 ] ; _store ( o . alsoResize ) ; }
830
+ else { $ . each ( o . alsoResize , function ( exp ) { _store ( exp ) ; } ) ; }
831
+ } else {
832
+ _store ( o . alsoResize ) ;
833
+ }
834
+ } ,
835
+
836
+ resize : function ( event , ui ) {
837
+ var that = $ ( this ) . data ( "ui-resizable" ) ,
838
+ o = that . options ,
839
+ os = that . originalSize ,
840
+ op = that . originalPosition ,
841
+ delta = {
842
+ height : ( that . size . height - os . height ) || 0 , width : ( that . size . width - os . width ) || 0 ,
843
+ top : ( that . position . top - op . top ) || 0 , left : ( that . position . left - op . left ) || 0
844
+ } ,
845
+
846
+ _alsoResize = function ( exp , c ) {
847
+ $ ( exp ) . each ( function ( ) {
848
+ var el = $ ( this ) , start = $ ( this ) . data ( "ui-resizable-alsoresize" ) , style = { } ,
849
+ css = c && c . length ? c : el . parents ( ui . originalElement [ 0 ] ) . length ? [ 'width' , 'height' ] : [ 'width' , 'height' , 'top' , 'left' ] ;
850
+
851
+ $ . each ( css , function ( i , prop ) {
852
+ var sum = ( start [ prop ] || 0 ) + ( delta [ prop ] || 0 ) ;
853
+ if ( sum && sum >= 0 ) {
854
+ style [ prop ] = sum || null ;
855
+ }
856
+ } ) ;
857
+
858
+ el . css ( style ) ;
859
+ } ) ;
860
+ } ;
861
+
862
+ if ( typeof ( o . alsoResize ) === 'object' && ! o . alsoResize . nodeType ) {
863
+ $ . each ( o . alsoResize , function ( exp , c ) { _alsoResize ( exp , c ) ; } ) ;
864
+ } else {
865
+ _alsoResize ( o . alsoResize ) ;
866
+ }
867
+ } ,
868
+
869
+ stop : function ( ) {
870
+ $ ( this ) . removeData ( "resizable-alsoresize" ) ;
871
+ }
872
+ } ) ;
873
+
874
874
$ . ui . plugin . add ( "resizable" , "ghost" , {
875
875
876
876
start : function ( ) {
0 commit comments