Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct slider init value and better FX slider event handling #109

Merged
merged 1 commit into from
Jun 18, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juliandescottes It could be nice to define somewhere exact targeted browsers for piskel. I know piskel don't work for now on IE10 but it's more because of a lack of testing than non-working code on IE10. So I'm not sure about this changeset that make it not work explicitly in IE10. Unless we don't care at all about IE10.
Thoughts ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed with the onchange it's less "bad" in the sense that it'll work everywhere, the user experience is just going to be a little bit worse on firefox than other browserm that's all. Your call.
On the long run, if you care about wider browser support, you're going to have to detect user agents and use both events anyway.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should ultimately support IE10. Regarding the browser support topic, I'm opening an issue to discuss it.
The sad part about this particular issue is that we can't feature-detect it, forced to use good old user agent detection.

@captainbrosset can you update this PR with a cross browser implementation ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about using a jquery-ui slider component that encapsulate the shit ?
Instead of using a broken thing ?

On Sun, Jun 16, 2013 at 1:20 AM, Julian Descottes
notifications@github.comwrote:

In js/controller/AnimatedPreviewController.js:

@@ -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
    

We should ultimately support IE10. Regarding the browser support topic,
I'm opening an issue to discuss it.
The sad part about this particular issue is that we can't feature-detect
it, forced to use good old user agent detection.

@captainbrosset https://github.com/captainbrosset can you update this
PR with a cross browser implementation ?


Reply to this email directly or view it on GitHubhttps://github.com/juliandescottes/piskel/pull/109/files#r4715094
.

$("#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