Comparing version 1.2.0 to 1.2.1
{ | ||
"name": "wordcloud", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Tag cloud/Wordle presentation on 2D canvas or HTML", | ||
@@ -5,0 +5,0 @@ "homepage": "http://timdream.org/wordcloud2.js/", |
@@ -171,3 +171,3 @@ /*! | ||
var timer; | ||
var timer = {}; | ||
var WordCloud = function WordCloud (elements, options) { | ||
@@ -178,2 +178,4 @@ if (!isSupported) { | ||
var timerId = Math.floor(Math.random() * Date.now()) | ||
if (!Array.isArray(elements)) { | ||
@@ -1152,3 +1154,2 @@ elements = [elements] | ||
canvas.removeEventListener('wordcloudstart', stopInteraction) | ||
canvas.removeEventListener('mousemove', wordcloudhover) | ||
@@ -1184,12 +1185,12 @@ canvas.removeEventListener('click', wordcloudclick) | ||
removeEventListener('wordcloudstart', anotherWordCloudStart) | ||
stoppingFunction(timer) | ||
stoppingFunction(timer[timerId]) | ||
} | ||
addEventListener('wordcloudstart', anotherWordCloudStart) | ||
timer = loopingFunction(function loop () { | ||
timer[timerId] = loopingFunction(function loop () { | ||
if (i >= settings.list.length) { | ||
stoppingFunction(timer) | ||
stoppingFunction(timer[timerId]) | ||
sendEvent('wordcloudstop', false) | ||
removeEventListener('wordcloudstart', anotherWordCloudStart) | ||
delete timer[timerId]; | ||
return | ||
@@ -1204,3 +1205,3 @@ } | ||
if (exceedTime() || canceled) { | ||
stoppingFunction(timer) | ||
stoppingFunction(timer[timerId]) | ||
settings.abort() | ||
@@ -1210,6 +1211,7 @@ sendEvent('wordcloudabort', false) | ||
removeEventListener('wordcloudstart', anotherWordCloudStart) | ||
delete timer[timerId] | ||
return | ||
} | ||
i++ | ||
timer = loopingFunction(loop, settings.wait) | ||
timer[timerId] = loopingFunction(loop, settings.wait) | ||
}, settings.wait) | ||
@@ -1226,3 +1228,5 @@ } | ||
if (timer) { | ||
window.clearImmediate(timer) | ||
for (const timerId in timer) { | ||
window.clearImmediate(timer[timerId]) | ||
} | ||
} | ||
@@ -1229,0 +1233,0 @@ } |
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
332413
2424