Skip to content

Commit 5c7a656

Browse files
committed
Fixed cancelAnimationFrame bad ids
1 parent be8b053 commit 5c7a656

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/components/vue-ui-donut.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function segregate(index) {
155155
const targetVal = target.value;
156156
function animUp() {
157157
if(initVal > targetVal) {
158-
cancelAnimationFrame(animUp);
158+
cancelAnimationFrame(rafUp.value);
159159
mutableSet.value = mutableSet.value.map((ds, i) => {
160160
if(index === i) {
161161
return {
@@ -187,7 +187,7 @@ function segregate(index) {
187187
} else if (segregated.value.length < immutableSet.value.length - 1) {
188188
function animDown() {
189189
if(initVal < 0.1) {
190-
cancelAnimationFrame(animDown);
190+
cancelAnimationFrame(rafDown.value);
191191
segregated.value.push(index);
192192
mutableSet.value = mutableSet.value.map((ds, i) => {
193193
if(index === i) {

src/components/vue-ui-nested-donuts.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function segregateDonut(item) {
223223
segregated.value = segregated.value.filter(s => s !== item.id);
224224
function animUp() {
225225
if(initVal > target.value) {
226-
cancelAnimationFrame(animUp);
226+
cancelAnimationFrame(rafUp.value);
227227
mutableDataset.value = mutableDataset.value.map(ds => {
228228
return {
229229
...ds,
@@ -263,7 +263,7 @@ function segregateDonut(item) {
263263
} else if(canSegregate) {
264264
function animDown() {
265265
if(initVal < 0.1) {
266-
cancelAnimationFrame(animDown);
266+
cancelAnimationFrame(rafDown.value);
267267
segregated.value.push(item.id);
268268
mutableDataset.value = mutableDataset.value.map((ds, i) => {
269269
return {

src/components/vue-ui-quick-chart.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function segregateDonut(arc, ds) {
142142
const targetVal = fd.value.dataset.find((el, i) => arc.id === `donut_${i}`).VALUE;
143143
function animUp() {
144144
if(initVal > targetVal) {
145-
cancelAnimationFrame(animUp)
145+
cancelAnimationFrame(rafUp.value)
146146
formattedDataset.value = {
147147
...formattedDataset.value,
148148
dataset: formattedDataset.value.dataset.map((ds, i) => {
@@ -180,7 +180,7 @@ function segregateDonut(arc, ds) {
180180
} else if(ds.length > 1) {
181181
function anim() {
182182
if(initVal < 0.1) {
183-
cancelAnimationFrame(anim)
183+
cancelAnimationFrame(raf.value)
184184
segregated.value.push(arc.id)
185185
formattedDataset.value = {
186186
...formattedDataset.value,

0 commit comments

Comments
 (0)