Skip to content

Commit

Permalink
correct slider init value and better FX slider event handling
Browse files Browse the repository at this point in the history
  • Loading branch information
captainbrosset committed Jun 15, 2013
1 parent 8210e42 commit f6f02c7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/controller/AnimatedPreviewController.js
Expand Up @@ -18,15 +18,19 @@
};

ns.AnimatedPreviewController.prototype.init = function () {
$("#preview-fps")[0].addEventListener('change', this.onFPSSliderChange.bind(this));
// the oninput event won't work on IE10 unfortunately, but at least will provide a
// consistent behavior across all other browsers that support the input type range
// see https://bugzilla.mozilla.org/show_bug.cgi?id=853670
$("#preview-fps")[0].addEventListener('input', this.onFPSSliderChange.bind(this));
};

ns.AnimatedPreviewController.prototype.onFPSSliderChange = function(evt) {
ns.AnimatedPreviewController.prototype.onFPSSliderChange = function (evt) {
this.setFPS(parseInt($("#preview-fps")[0].value, 10));
};

ns.AnimatedPreviewController.prototype.setFPS = function (fps) {
this.fps = fps;
$("#preview-fps").val(this.fps);
$("#display-fps").html(this.fps + " FPS");
};

Expand Down

0 comments on commit f6f02c7

Please sign in to comment.