[jifty-devel] Re: [Jifty-commit] r3360 - jifty/trunk/lib/Jifty/Web

Jesse Vincent jesse at bestpractical.com
Tue Jun 5 17:11:51 EDT 2007


Could we do this with a trigger here?

On Jun 5, 2007, at 3:42 PM, jifty-commit at lists.jifty.org wrote:

> Author: clkao
> Date: Tue Jun  5 15:42:28 2007
> New Revision: 3360
>
> Modified:
>    jifty/trunk/lib/Jifty/Web/Form.pm
>
> Log:
> SinglePage submit hack.
>
> Modified: jifty/trunk/lib/Jifty/Web/Form.pm
> ====================================================================== 
> ========
> --- jifty/trunk/lib/Jifty/Web/Form.pm	(original)
> +++ jifty/trunk/lib/Jifty/Web/Form.pm	Tue Jun  5 15:42:28 2007
> @@ -217,8 +217,19 @@
>
>  sub submit {
>      my $self = shift;
> -
> -    my $button = Jifty::Web::Form::Clickable->new(submit => undef,  
> @_)->generate;
> +    my %args = ( submit => undef, @_ );
> +    my ($spa) = Jifty->find_plugin('Jifty::Plugin::SinglePage');
> +    if ($spa) {
> +	# XXX: merge with _sp_link hook.
> +	if ($args{onclick}) {
> +	    Carp::cluck "already has onclick, fix me later";
> +	}
> +	else {
> +	    my $submit = delete $args{submit} || [undef]; # something  
> special for js to handle
> +	    $args{onclick} = {submit => $submit, refresh_self => 1};
> +	}
> +    }
> +    my $button = Jifty::Web::Form::Clickable->new(%args)->generate;
>      Jifty->web->out(qq{<div class="submit_button">});
>      $button->render_widget;
>      Jifty->web->out(qq{</div>});
> _______________________________________________
> Jifty-commit mailing list
> Jifty-commit at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-commit
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20070605/2fd01c91/PGP.pgp


More information about the jifty-devel mailing list