Skip to content

Commit f7ec502

Browse files
committed
Draggable: Using this.document and this.window instead of doc/win
1 parent ec846fb commit f7ec502

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ui/jquery.ui.draggable.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ $.widget( "ui.draggable", {
150150
this.dragEl
151151
// TODO: should we move this to the stylesheet and use a class?
152152
.css( "position", "absolute" )
153-
.appendTo( this.doc[0].body )
153+
.appendTo( this.document[0].body )
154154
.offset( this.element.offset() );
155155
}
156156

@@ -170,17 +170,17 @@ $.widget( "ui.draggable", {
170170
};
171171

172172
// Cache the offset of scrollParent, if required for _handleScrolling
173-
if ( this.scrollParent[0] != this.doc[0] && this.scrollParent[0].tagName != 'HTML') {
173+
if ( this.scrollParent[0] != this.document[0] && this.scrollParent[0].tagName != 'HTML') {
174174
this.overflowOffset = this.scrollParent.offset();
175175
}
176176

177177
this.overflow = {};
178178

179-
this.overflow.height = ( this.scrollParent[0] === this.doc[0] ) ?
180-
this.win.height() : this.scrollParent.height();
179+
this.overflow.height = ( this.scrollParent[0] === this.document[0] ) ?
180+
this.window.height() : this.scrollParent.height();
181181

182-
this.overflow.width = ( this.scrollParent[0] === this.doc[0] ) ?
183-
this.win.width() : this.scrollParent.width();
182+
this.overflow.width = ( this.scrollParent[0] === this.document[0] ) ?
183+
this.window.width() : this.scrollParent.width();
184184

185185
this._preparePosition( event );
186186

@@ -189,13 +189,13 @@ $.widget( "ui.draggable", {
189189
// TODO: should user be able to change position of draggable, if event stopped?
190190
// If user stops propagation, leave helper there ( if there's one ), disallow any CSS changes
191191
if ( event.cancelBubble === true ) {
192-
this.doc.unbind( "." + this.widgetName );
192+
this.document.unbind( "." + this.widgetName );
193193
return;
194194
}
195195

196196
this._setCss( event );
197197

198-
this._bind( this.doc, {
198+
this._bind( this.document, {
199199
mousemove: "_mouseMove",
200200
mouseup: "_mouseUp"
201201
});
@@ -211,7 +211,7 @@ $.widget( "ui.draggable", {
211211
// TODO: should user be able to change position of draggable, if event stopped?
212212
// If user stops propagation, leave helper there ( if there's one ), disallow any CSS changes
213213
if ( event.cancelBubble === true ) {
214-
this.doc.unbind( "." + this.widgetName );
214+
this.document.unbind( "." + this.widgetName );
215215
return;
216216
}
217217

@@ -239,7 +239,7 @@ $.widget( "ui.draggable", {
239239

240240
}
241241

242-
this.doc.unbind( "." + this.widgetName );
242+
this.document.unbind( "." + this.widgetName );
243243
},
244244

245245
// Uses event to determine new position of draggable, before any override from callbacks

0 commit comments

Comments
 (0)