@@ -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" ) ) {
@@ -630,24 +650,6 @@ $.ui.plugin.add("draggable", "cursor", {
630
650
}
631
651
} ) ;
632
652
633
- $ . ui . plugin . add ( "draggable" , "iframeFix" , {
634
- start : function ( event , ui ) {
635
- var o = $ ( this ) . data ( 'draggable' ) . options ;
636
- $ ( o . iframeFix === true ? "iframe" : o . iframeFix ) . each ( function ( ) {
637
- $ ( '<div class="ui-draggable-iframeFix" style="background: #fff;"></div>' )
638
- . css ( {
639
- width : this . offsetWidth + "px" , height : this . offsetHeight + "px" ,
640
- position : "absolute" , opacity : "0.001" , zIndex : 1000
641
- } )
642
- . css ( $ ( this ) . offset ( ) )
643
- . appendTo ( "body" ) ;
644
- } ) ;
645
- } ,
646
- stop : function ( event , ui ) {
647
- $ ( "div.ui-draggable-iframeFix" ) . each ( function ( ) { this . parentNode . removeChild ( this ) ; } ) ; //Remove frame helpers
648
- }
649
- } ) ;
650
-
651
653
$ . ui . plugin . add ( "draggable" , "opacity" , {
652
654
start : function ( event , ui ) {
653
655
var t = $ ( ui . helper ) , o = $ ( this ) . data ( 'draggable' ) . options ;
0 commit comments