Commit 401887ff authored by 李维's avatar 李维

清除计时器

parent 25279758
...@@ -223,9 +223,10 @@ cc.Class({ ...@@ -223,9 +223,10 @@ cc.Class({
}, },
setTimeoutID: null,
setProgress(progress) { setProgress(progress) {
const dragStartX = -520; const dragStartX = -520;
setTimeout(() => { this.setTimeoutID = setTimeout(() => {
const w = this.barBaseW * progress; const w = this.barBaseW * progress;
this.bar.width = w; this.bar.width = w;
if(!this.userDragStart) { if(!this.userDragStart) {
...@@ -238,5 +239,6 @@ cc.Class({ ...@@ -238,5 +239,6 @@ cc.Class({
for(let i=0; i<this.setIntervalIDs.length; i++) { for(let i=0; i<this.setIntervalIDs.length; i++) {
clearInterval(this.setIntervalIDs[i]); clearInterval(this.setIntervalIDs[i]);
} }
clearTimeout(this.setTimeoutID);
} }
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment