Skip to content

Commit

Permalink
🛠 variable isThrottled
Browse files Browse the repository at this point in the history
  • Loading branch information
desandro committed Apr 10, 2018
1 parent 101f996 commit 794d045
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/packery.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,8 @@ proto.itemDragMove = function( elem, x, y ) {

// throttle
var now = new Date();
if ( this._itemDragTime && now - this._itemDragTime < DRAG_THROTTLE_TIME ) {
var isThrottled = this._itemDragTime && now - this._itemDragTime < DRAG_THROTTLE_TIME;
if ( isThrottled ) {
clearTimeout( this.dragTimeout );
this.dragTimeout = setTimeout( onDrag, DRAG_THROTTLE_TIME );
} else {
Expand Down

0 comments on commit 794d045

Please sign in to comment.