dynamic-marquee
Advanced tools
Comparing version 2.1.4 to 2.1.5
@@ -329,2 +329,3 @@ (function (global, factory) { | ||
this._justReversedRate = false; | ||
this._lastUpdateTime = null; | ||
this._direction = upDown ? DIRECTION.DOWN : DIRECTION.RIGHT; | ||
@@ -569,2 +570,11 @@ this._onItemRequired = []; | ||
{ | ||
key: '_cleanup', | ||
value: function _cleanup() { | ||
this._containerSizeWatcher.tearDown(); | ||
this._containerSizeWatcher = null; | ||
this._lastUpdateTime = null; | ||
}, | ||
}, | ||
{ | ||
key: '_tick', | ||
@@ -577,5 +587,4 @@ value: function _tick() { | ||
if (!this._items.length && !this._pendingItem) { | ||
this._containerSizeWatcher.tearDown(); | ||
this._cleanup(); | ||
this._containerSizeWatcher = null; | ||
return; | ||
@@ -589,9 +598,6 @@ } | ||
var now = performance.now(); | ||
var timePassed = now - this._lastUpdateTime; | ||
var timePassed = this._lastUpdateTime | ||
? now - this._lastUpdateTime | ||
: 0; | ||
this._lastUpdateTime = now; | ||
if (this._rate) { | ||
this._scheduleRender(); | ||
} | ||
this._rendering = true; | ||
@@ -608,2 +614,8 @@ var shiftAmount = this._lastRate * (timePassed / 1000); | ||
this._rendering = false; | ||
if (this._rate) { | ||
this._scheduleRender(); | ||
} else { | ||
this._cleanup(); | ||
} | ||
}, | ||
@@ -610,0 +622,0 @@ }, |
{ | ||
"name": "dynamic-marquee", | ||
"version": "2.1.4", | ||
"version": "2.1.5", | ||
"description": "A small library for creating marquees.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/dynamic-marquee.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45089
838