[Jifty-commit] r1514 - in jifty/trunk: lib/Jifty/Web/Form

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Fri Jul 7 22:53:18 EDT 2006


Author: jesse
Date: Fri Jul  7 22:53:18 2006
New Revision: 1514

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Web/Form/Clickable.pm

Log:
 r13652 at pinglin:  jesse | 2006-07-07 20:29:52 -0400
 * toggleable page region clickables weren't doing the right thing when used in non-ajax mode


Modified: jifty/trunk/lib/Jifty/Web/Form/Clickable.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form/Clickable.pm	(original)
+++ jifty/trunk/lib/Jifty/Web/Form/Clickable.pm	Fri Jul  7 22:53:18 2006
@@ -506,9 +506,16 @@
             my $region = ref $hook->{region} ? $hook->{region} : Jifty->web->get_region( $hook->{region} );
 
             if ($hook->{replace_with}) {
+                my $currently_shown = '';
+                if ($region) {
+
+                my $state_var = Jifty->web->request->state_variable("region-".$region->qualified_name);
+                $currently_shown = $state_var->value if ($state_var);
+                } 
                 # Toggle region if the toggle flag is set, and clicking wouldn't change path
-                if ($hook->{toggle} and $region and $hook->{replace_with} eq $region->path) {
-                    $self->region_fragment( $hook->{region}, "/__jifty/empty" )
+                if ($hook->{toggle} and $hook->{replace_with} eq $currently_shown) {
+                    $self->region_fragment( $hook->{region}, "/__jifty/empty" );
+#                    Jifty->web->request->remove_state_variable('region-'.$region->qualified_name);
                 } else {
                     $self->region_fragment( $hook->{region}, $hook->{replace_with} )
                 }


More information about the Jifty-commit mailing list