@@ -79,6 +79,16 @@ $.widget("ui.draggable", $.ui.mouse, {
79
79
this . handle = this . _getHandle ( event ) ;
80
80
if ( ! this . handle )
81
81
return false ;
82
+
83
+ $ ( o . iframeFix === true ? "iframe" : o . iframeFix ) . each ( function ( ) {
84
+ $ ( '<div class="ui-draggable-iframeFix" style="background: #fff;"></div>' )
85
+ . css ( {
86
+ width : this . offsetWidth + "px" , height : this . offsetHeight + "px" ,
87
+ position : "absolute" , opacity : "0.001" , zIndex : 1000
88
+ } )
89
+ . css ( $ ( this ) . offset ( ) )
90
+ . appendTo ( "body" ) ;
91
+ } ) ;
82
92
83
93
return true ;
84
94
@@ -212,6 +222,16 @@ $.widget("ui.draggable", $.ui.mouse, {
212
222
return false ;
213
223
} ,
214
224
225
+ _mouseUp : function ( event ) {
226
+ if ( this . options . iframeFix === true ) {
227
+ $ ( "div.ui-draggable-iframeFix" ) . each ( function ( ) {
228
+ this . parentNode . removeChild ( this ) ;
229
+ } ) ; //Remove frame helpers
230
+ }
231
+
232
+ return $ . ui . mouse . prototype . _mouseUp . call ( this , event ) ;
233
+ } ,
234
+
215
235
cancel : function ( ) {
216
236
217
237
if ( this . helper . is ( ".ui-draggable-dragging" ) ) {
@@ -616,24 +636,6 @@ $.ui.plugin.add("draggable", "cursor", {
616
636
}
617
637
} ) ;
618
638
619
- $ . ui . plugin . add ( "draggable" , "iframeFix" , {
620
- start : function ( event , ui ) {
621
- var o = $ ( this ) . data ( 'draggable' ) . options ;
622
- $ ( o . iframeFix === true ? "iframe" : o . iframeFix ) . each ( function ( ) {
623
- $ ( '<div class="ui-draggable-iframeFix" style="background: #fff;"></div>' )
624
- . css ( {
625
- width : this . offsetWidth + "px" , height : this . offsetHeight + "px" ,
626
- position : "absolute" , opacity : "0.001" , zIndex : 1000
627
- } )
628
- . css ( $ ( this ) . offset ( ) )
629
- . appendTo ( "body" ) ;
630
- } ) ;
631
- } ,
632
- stop : function ( event , ui ) {
633
- $ ( "div.ui-draggable-iframeFix" ) . each ( function ( ) { this . parentNode . removeChild ( this ) ; } ) ; //Remove frame helpers
634
- }
635
- } ) ;
636
-
637
639
$ . ui . plugin . add ( "draggable" , "opacity" , {
638
640
start : function ( event , ui ) {
639
641
var t = $ ( ui . helper ) , o = $ ( this ) . data ( 'draggable' ) . options ;
0 commit comments