stephband/jquery.event.move

currentTarget for delegated events

Closed this issue · 3 comments

Is there a way to get currentTarget to work correctly with delegated events or am I doing something wrong?

$(".itemPalette").on "movestart", ".item", (e) ->
  $(e.currentTarget) # is document rather than .item

Ooo, it shouldn't do that. I don't know if it's wrong because I'm not
familiar with CoffeScript, but I haven't run into this problem. Is it
happening on move and moveend as well as movestart?

On 21 January 2013 21:03, Daniel X Moore notifications@github.com wrote:

Is there a way to get currentTarget to work correctly with delegated
events or am I doing something wrong?

$(".itemPalette").on "movestart", ".item", (e) ->
$(e.currentTarget) # is document rather than .item


Reply to this email directly or view it on GitHubhttps://github.com//issues/11.

Furthermore, why is it document, and not .itemPalette ?

On 21 January 2013 21:06, Stephen Band stephband@googlemail.com wrote:

Ooo, it shouldn't do that. I don't know if it's wrong because I'm not
familiar with CoffeScript, but I haven't run into this problem. Is it
happening on move and moveend as well as movestart?

On 21 January 2013 21:03, Daniel X Moore notifications@github.com wrote:

Is there a way to get currentTarget to work correctly with delegated
events or am I doing something wrong?

$(".itemPalette").on "movestart", ".item", (e) ->
$(e.currentTarget) # is document rather than .item


Reply to this email directly or view it on GitHubhttps://github.com//issues/11.

Actually I think it may have been an error in my usage. I was migrating some code from a global draggable where some events were bound on document and some were delegated. Upon further inspection it seems to be working correctly.

Thanks for the quick response!