Scott:
Sounds like a good rule, but I assume you still allow the plugin to
change its own
data (which is stored in this.options), as long as it's not a
documented, user-set option.
So
o.acceptFn = $.isFunction(accept) ? accept : function(d) { return
d.is(accept) };
would work, then change all the
this.options.accept.call(...
to
this.options.acceptFn.call(...
I'll file that ticket.
Danny
On Mar 5, 12:19 pm, Scott González <
scott.gonza...@gmail.com> wrote:
> This code actually needs to be rewritten anyway because it violates one of
> our rules (plugins may never change an option value to be something other
> than what was explicitly set by the user). Feel free to file a ticket for
> this athttp://
dev.jqueryui.com/newticket(requires registration). We'll be
> fixing this for 1.8 in all plugins.
>
> And
>
> > (this.options.addClasses && this.element.addClass("ui-droppable"));
>
> > is a funny idiom. Why not the clearer
> > if (o.addClasses) this.element.addClass("ui-droppable"));
>
> We use this to save two bytes because we require all if blocks to have curly
> braces. (a && b) is shorter than if (a) { b }
I think I remember that discussion from jquery-dev . I'd still vote
for the "if" form.