From f7ec5029922af49d0637d17758271bdb3c40f731 Mon Sep 17 00:00:00 2001 From: Corey Frang Date: Thu, 27 Oct 2011 21:39:33 -0500 Subject: [PATCH] Draggable: Using this.document and this.window instead of doc/win --- ui/jquery.ui.draggable.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index f3842c9b5..f073fab53 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -150,7 +150,7 @@ $.widget( "ui.draggable", { this.dragEl // TODO: should we move this to the stylesheet and use a class? .css( "position", "absolute" ) - .appendTo( this.doc[0].body ) + .appendTo( this.document[0].body ) .offset( this.element.offset() ); } @@ -170,17 +170,17 @@ $.widget( "ui.draggable", { }; // Cache the offset of scrollParent, if required for _handleScrolling - if ( this.scrollParent[0] != this.doc[0] && this.scrollParent[0].tagName != 'HTML') { + if ( this.scrollParent[0] != this.document[0] && this.scrollParent[0].tagName != 'HTML') { this.overflowOffset = this.scrollParent.offset(); } this.overflow = {}; - this.overflow.height = ( this.scrollParent[0] === this.doc[0] ) ? - this.win.height() : this.scrollParent.height(); + this.overflow.height = ( this.scrollParent[0] === this.document[0] ) ? + this.window.height() : this.scrollParent.height(); - this.overflow.width = ( this.scrollParent[0] === this.doc[0] ) ? - this.win.width() : this.scrollParent.width(); + this.overflow.width = ( this.scrollParent[0] === this.document[0] ) ? + this.window.width() : this.scrollParent.width(); this._preparePosition( event ); @@ -189,13 +189,13 @@ $.widget( "ui.draggable", { // TODO: should user be able to change position of draggable, if event stopped? // If user stops propagation, leave helper there ( if there's one ), disallow any CSS changes if ( event.cancelBubble === true ) { - this.doc.unbind( "." + this.widgetName ); + this.document.unbind( "." + this.widgetName ); return; } this._setCss( event ); - this._bind( this.doc, { + this._bind( this.document, { mousemove: "_mouseMove", mouseup: "_mouseUp" }); @@ -211,7 +211,7 @@ $.widget( "ui.draggable", { // TODO: should user be able to change position of draggable, if event stopped? // If user stops propagation, leave helper there ( if there's one ), disallow any CSS changes if ( event.cancelBubble === true ) { - this.doc.unbind( "." + this.widgetName ); + this.document.unbind( "." + this.widgetName ); return; } @@ -239,7 +239,7 @@ $.widget( "ui.draggable", { } - this.doc.unbind( "." + this.widgetName ); + this.document.unbind( "." + this.widgetName ); }, // Uses event to determine new position of draggable, before any override from callbacks