Skip to content

Commit a566ba5

Browse files
committed
Lint fixes per grunt
1 parent ca835b8 commit a566ba5

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

jquery.simulate.js

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ $.extend( $.simulate.prototype, {
286286
},
287287
makeDragger: function () {
288288
return new $.simulate.dragger(this);
289-
},
289+
}
290290
});
291291

292292
$.simulate.dragger = function (simulator) {
@@ -296,35 +296,41 @@ $.simulate.dragger = function (simulator) {
296296
};
297297
$.extend( $.simulate.dragger.prototype, {
298298
start: function (target) {
299-
if ( this.started || this.ended ) return;
299+
if ( this.started || this.ended ) {
300+
return;
301+
}
300302

301303
this.started = true;
302304
this.target = target;
303305
var center = findCenter( target );
304306
this.coord = {
305307
clientX: Math.floor(center.x),
306-
clientY: Math.floor(center.y),
308+
clientY: Math.floor(center.y)
307309
};
308310

309311
this.simulator.simulateEvent( target, "mousedown", this.coord );
310312
},
311313
move: function (delta) {
312-
if (!this.started || this.ended) return;
314+
if (!this.started || this.ended) {
315+
return;
316+
}
313317

314318
var moves = delta.steps || 3,
315319
dx = Math.floor(delta.dx || 0),
316-
dy = Math.floor(delta.dy || 0);
317-
318-
var final_coord = {
319-
clientX: this.coord.clientX + dx,
320-
clientY: this.coord.clientY + dy,
321-
};
322-
323-
for ( var i=0 ; i < moves-1 ; i++ ) {
324-
var x = (dx / moves);
325-
var y = (dy / moves);
326-
327-
var coord = {
320+
dy = Math.floor(delta.dy || 0),
321+
final_coord = {
322+
clientX: this.coord.clientX + dx,
323+
clientY: this.coord.clientY + dy
324+
},
325+
i = 0,
326+
x = 0,
327+
y = 0,
328+
coord = {};
329+
330+
for ( i=0 ; i < moves-1 ; i++ ) {
331+
x = (dx / moves);
332+
y = (dy / moves);
333+
coord = {
328334
clientX: Math.round( x ),
329335
clientY: Math.round( y )
330336
};
@@ -337,7 +343,9 @@ $.extend( $.simulate.dragger.prototype, {
337343

338344
},
339345
end: function (delta) {
340-
if (!this.started || this.ended) return;
346+
if (!this.started || this.ended) {
347+
return;
348+
}
341349
if ( delta ) {
342350
this.move(delta);
343351
}
@@ -346,7 +354,7 @@ $.extend( $.simulate.dragger.prototype, {
346354

347355
this.simulator.simulateEvent( this.target, "mouseup", this.coord );
348356
this.simulator.simulateEvent( this.target, "click", this.coord );
349-
},
357+
}
350358
});
351359

352360
})( jQuery );

0 commit comments

Comments
 (0)