page[:element].disable/enable patch

1 view
Skip to first unread message

Greg Fitzgerald

unread,
Sep 14, 2008, 4:15:02 PM9/14/08
to jra...@googlegroups.com
Small patch to enable some functionality that was missing from jrails. I
was doing the following in my rjs template.

page[:comment_form].disable then later on I was enabling it with
page[:comment_form].enable.

Not sure if this is the best way to add the functionality as I'm new to
rails and even newer to jquery.

Patch is attached to the email.
--
Greg Fitzgerald

EnableDisable.patch

Greg Fitzgerald

unread,
Sep 14, 2008, 4:30:13 PM9/14/08
to jra...@googlegroups.com

> --- jrails.js 2008-09-14 15:32:29.000000000 -0400
> +++ /home/gregf/myjrails/javascripts/sources/jrails.js 2008-09-14 15:31:51.000000000 -0400
> @@ -175,6 +175,12 @@
> },
> switchOn : function(speed, callback) {
> return this.show('clip', {}, speed, callback);
> - }
> + },
> + disable : function(callback) {
> + return this.attr('disabled', 'true', callback);
> + },
> + enable : function(callback) {
> + return this.attr('enabled', 'true', callback);
> + }
> });
> })(jQuery);

Shoot, just realized after I sent this according to the jquery docs attr
does not have a callback. So that should be taking out of the patch.

--
Greg Fitzgerald

Aaron Eisenberger

unread,
Sep 14, 2008, 4:31:28 PM9/14/08
to jra...@googlegroups.com
no problems. I'll fix it up :)

Thanks!

-A
Reply all
Reply to author
Forward
0 new messages