diff options
Diffstat (limited to 'ui/widgets/draggable.js')
-rw-r--r-- | ui/widgets/draggable.js | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/ui/widgets/draggable.js b/ui/widgets/draggable.js index 5f41d2408..2a9666d4e 100644 --- a/ui/widgets/draggable.js +++ b/ui/widgets/draggable.js @@ -15,6 +15,8 @@ //>>css.structure: ../../themes/base/draggable.css ( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. @@ -34,7 +36,8 @@ // Browser globals factory( jQuery ); } -}( function( $ ) { +} )( function( $ ) { +"use strict"; $.widget( "ui.draggable", $.ui.mouse, { version: "@VERSION", @@ -201,7 +204,9 @@ $.widget( "ui.draggable", $.ui.mouse, { this.originalPageY = event.pageY; //Adjust the mouse offset relative to the helper if "cursorAt" is supplied - ( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) ); + if ( o.cursorAt ) { + this._adjustOffsetFromHelper( o.cursorAt ); + } //Set a containment if given in the options this._setContainment(); @@ -1116,12 +1121,13 @@ $.ui.plugin.add( "draggable", "snap", { !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) { if ( inst.snapElements[ i ].snapping ) { - ( inst.options.snap.release && + if ( inst.options.snap.release ) { inst.options.snap.release.call( inst.element, event, $.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } ) - ) ); + ); + } } inst.snapElements[ i ].snapping = false; continue; @@ -1192,13 +1198,14 @@ $.ui.plugin.add( "draggable", "snap", { } if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs || first ) ) { - ( inst.options.snap.snap && + if ( inst.options.snap.snap ) { inst.options.snap.snap.call( inst.element, event, $.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item - } ) ) ); + } ) ); + } } inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first ); @@ -1216,7 +1223,9 @@ $.ui.plugin.add( "draggable", "stack", { ( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 ); } ); - if ( !group.length ) { return; } + if ( !group.length ) { + return; + } min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0; $( group ).each( function( i ) { @@ -1247,4 +1256,4 @@ $.ui.plugin.add( "draggable", "zIndex", { return $.ui.draggable; -} ) ); +} ); |