aterrien / jQuery-Knob

Nice, downward compatible, touchable, jQuery dial
http://anthonyterrien.com/knob/
MIT License
5.03k stars 1.24k forks source link

Touch/Click Event on Hold #73

Open sivix opened 11 years ago

sivix commented 11 years ago

I would like to have a delay between Touch/Click event and effective change on Value, to avoid erratic click during the normal usage in a UI. How would be possible to do this?

I've already changed the code with e.stopPropagation(); in clicks / touch to avoid interaction with other UI elements (containters).

Thanks, Andrea.

dapinitial commented 11 years ago

Is this a viable solution Andrea? I am about to begin working on the same.

sivix commented 11 years ago

Hi dapinitial, yes it worked for me, here a snip of what I've changed:

<....> this._touch = function (e) { e.stopPropagation(); // Sivix <....>

Regards, Andrea.

dapinitial commented 11 years ago

Very cool. What were you using this knob for anyways?? It's super versatile!!

On Thu, Jun 20, 2013 at 12:08 AM, sivix notifications@github.com wrote:

Hi dapinitial, yes it worked for me, here a snip of what I've changed:

<....> this._touch = function (e) { e.stopPropagation(); // Sivix <....>

Regards, Andrea.

— Reply to this email directly or view it on GitHubhttps://github.com/aterrien/jQuery-Knob/issues/73#issuecomment-19734233 .

sivix commented 11 years ago

Hi, I'm using it in my hobby domotic project, here latest release: https://googledrive.com/host/0B20x53FlNJHvdVJJZDlVWC1tRlU/

it talk with a jWebsocket server on a raspberry connected to an arduino for reading temp/umid and other sensors.

it has also a simulation ;-)

Cheers,

Andrea "Simple doesn't always mean easy."

On 20/giu/2013, at 21:52, David Puerto notifications@github.com wrote:

Very cool. What were you using this knob for anyways?? It's super versatile!!

On Thu, Jun 20, 2013 at 12:08 AM, sivix notifications@github.com wrote:

Hi dapinitial, yes it worked for me, here a snip of what I've changed:

<....> this._touch = function (e) { e.stopPropagation(); // Sivix <....>

Regards, Andrea.

— Reply to this email directly or view it on GitHubhttps://github.com/aterrien/jQuery-Knob/issues/73#issuecomment-19734233 .

— Reply to this email directly or view it on GitHub.

dapinitial commented 11 years ago

That's rad, I don't even know you and I love you. I like to tinker too, but yours is more than just prototype! Hells yeah, high five! When I am further along with mine I will show you what I have, but I better step my game up and hook it into some live data!!!

On Thu, Jun 20, 2013 at 1:34 PM, sivix notifications@github.com wrote:

Hi, I'm using it in my hobby domotic project, here latest release: https://googledrive.com/host/0B20x53FlNJHvdVJJZDlVWC1tRlU/

it talk with a jWebsocket server on a raspberry connected to an arduino for reading temp/umid and other sensors.

it has also a simulation ;-)

Cheers,

Andrea +393401783770 "Simple doesn't always mean easy."

On 20/giu/2013, at 21:52, David Puerto notifications@github.com wrote:

Very cool. What were you using this knob for anyways?? It's super versatile!!

On Thu, Jun 20, 2013 at 12:08 AM, sivix notifications@github.com wrote:

Hi dapinitial, yes it worked for me, here a snip of what I've changed:

<....> this._touch = function (e) { e.stopPropagation(); // Sivix <....>

Regards, Andrea.

— Reply to this email directly or view it on GitHub< https://github.com/aterrien/jQuery-Knob/issues/73#issuecomment-19734233> .

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/aterrien/jQuery-Knob/issues/73#issuecomment-19781280 .

genox commented 10 years ago

Hi there,

I have a similar case here: I use the mighty Knob with Ionic framework, where I use several elements spread on multiple slides. To stop slides from sliding while interacting with the knob, I had to add

e.stopPropagation();

at the end of these blocks:

... var touchMove = function (e) { ...

and

... var mouseMove = function (e) { ...

I think it would be worth considering adding these, as it makes sure that touch events don't bubble up the DOM tree when the element is used in more complex environments (HTML5 Apps and so on).

Thanks for this cool widget!

edit: Meh. :-( While I was able to stop propagation of the mouse events, the touch events still end up on the elements underneath the knob. So, only half way there.

edit 2: Turns out this is a browser bug of CocoonJS' WebView+ Implementation. Works fine with everything else!