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

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

merged 1 commit into from Jun 18, 2013

Conversation

captainbrosset
Copy link
Contributor

Trying to fix issue https://github.com/juliandescottes/piskel/issues/98
2 changes done:

  • Setting the value of the range input in the setFPS function so that loading existing framesheets from a service actually sets the slider correctly
  • Changing the onchange event listener to oninput in order to change the FPS value while dragging on all browsers (namely on FX)

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

@juliandescottes
Copy link
Collaborator

Firefox doesn't support <input type="range"> apparently (they will starting with Firefox 23 see https://bugzilla.mozilla.org/show_bug.cgi?id=344618).

In the meantime, I'm reverting back to onchange.

Otherwise, tested the fix, works great ! thanks @captainbrosset

Merge ongoing ...

@juliandescottes juliandescottes merged commit f6f02c7 into piskelapp:master Jun 18, 2013
@captainbrosset
Copy link
Contributor Author

Just came across this article http://benalpert.com/2013/06/18/a-near-perfect-oninput-shim-for-ie-8-and-9.html which talks about how to put in place an oninput shim for IE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants