aboutsummaryrefslogtreecommitdiffstats
path: root/ui/widgets/mouse.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/widgets/mouse.js')
-rw-r--r--ui/widgets/mouse.js21
1 files changed, 16 insertions, 5 deletions
diff --git a/ui/widgets/mouse.js b/ui/widgets/mouse.js
index 0ae8979a1..1efcf08db 100644
--- a/ui/widgets/mouse.js
+++ b/ui/widgets/mouse.js
@@ -13,6 +13,8 @@
//>>docs: http://api.jqueryui.com/mouse/
( function( factory ) {
+ "use strict";
+
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
@@ -27,7 +29,8 @@
// Browser globals
factory( jQuery );
}
-}( function( $ ) {
+} )( function( $ ) {
+"use strict";
var mouseHandled = false;
$( document ).on( "mouseup", function() {
@@ -80,7 +83,9 @@ return $.widget( "ui.mouse", {
this._mouseMoved = false;
// We may have missed mouseup (out of window)
- ( this._mouseStarted && this._mouseUp( event ) );
+ if ( this._mouseStarted ) {
+ this._mouseUp( event );
+ }
this._mouseDownEvent = event;
@@ -173,7 +178,11 @@ return $.widget( "ui.mouse", {
if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
this._mouseStarted =
( this._mouseStart( this._mouseDownEvent, event ) !== false );
- ( this._mouseStarted ? this._mouseDrag( event ) : this._mouseUp( event ) );
+ if ( this._mouseStarted ) {
+ this._mouseDrag( event );
+ } else {
+ this._mouseUp( event );
+ }
}
return !this._mouseStarted;
@@ -220,7 +229,9 @@ return $.widget( "ui.mouse", {
_mouseStart: function( /* event */ ) {},
_mouseDrag: function( /* event */ ) {},
_mouseStop: function( /* event */ ) {},
- _mouseCapture: function( /* event */ ) { return true; }
+ _mouseCapture: function( /* event */ ) {
+ return true;
+ }
} );
-} ) );
+} );