Skip to content

Commit

Permalink
[fix] Moved level id to bindEvent function
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Aug 8, 2019
1 parent d0af184 commit 0a68463
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions justgage.js
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,8 @@
};


this.bindEvent("raphael.anim.finish." + (obj.level.id), onFinish)
this.bindEvent("raphael.anim.frame." + (obj.level.id), onFrame)
this.bindEvent("raphael.anim.finish", onFinish)
this.bindEvent("raphael.anim.frame", onFrame)

} else {
//on animation start
Expand All @@ -777,7 +777,7 @@
setDy(obj.txtValue, obj.params.valueFontSize, obj.params.valueY);
};

this.bindEvent("raphael.anim.start." + (obj.level.id), onStart)
this.bindEvent("raphael.anim.start", onStart)
}

// animate gauge level, value & label
Expand Down Expand Up @@ -832,6 +832,9 @@
* @param {Function} func The function to call on that event
*/
JustGage.prototype.bindEvent = function (eventName, func) {
// add the level id to the event
eventName += '.' + this.level.id

//check for existing bind events
if(this.events[eventName])
Raphael.eve.off(eventName, this.events[eventName])
Expand Down

0 comments on commit 0a68463

Please sign in to comment.