Google Groups Home
Help | Sign in
Message from discussion delegating in jquery: problems
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Sudara  
View profile
 More options 28 Mar, 16:38
From: Sudara <markswilli...@gmail.com>
Date: Fri, 28 Mar 2008 09:38:22 -0700 (PDT)
Local: Fri 28 Mar 2008 16:38
Subject: Re: delegating in jquery: problems
So, the latest version in git seems to cause issue #3

The version before works great:

http://github.com/danwrong/low-pro-for-jquery/tree/c1dc9b8f95f0bd40fe...

re: #2 I have been manually return false, or returning my function
which returns false and stops the default behaviour.

Syntactically, the existing:

  onclick: $.delegate({
    '.play_link' : function(e){ return this.togglePlay(e)},
    '.track_link': function(e){ return this.toggleOptions(e)}
  }),

would be even nicer (for my usage, at least) like so:

  onclick: $.delegate({
    '.play_link' :this.togglePlay(e),
    '.track_link': this.toggleOptions(e)
  }),

or heck, in behaviors, I often initialize and set some variables like
so:

initialize: function() {
    this.playLink = $(".play-button",this.element);
    this.trackLink = $("a.track_link",this.element);
  }

how cool would this be:

  onclick: $.delegate({
    this.playLink :this.togglePlay(),
    this.toggleLink: this.toggleOptions()
  })

Of course, I'm not great with the javascript metaprogramming, but heck
that would be the awesomist API.

Thanks again for your work Dan - it's opened my eyes to some great
techniques.

Sudara

On 27 Mar, 22:21, Sudara <markswilli...@gmail.com> wrote:

> Oh, and we're talking latest git release of lowpro for jquery as of
> March 27, 2008 and jquery 1.2.3

> On 27 Mar, 18:32, Sudara <markswilli...@gmail.com> wrote:

> > A quick clarification for #2 - by "continues to bubble" i really mean,
> > the default action is executed.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google