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

Jifty commits jifty-commit at lists.jifty.org
Tue Aug 18 22:49:09 EDT 2009


Author: sartak
Date: Tue Aug 18 22:49:08 2009
New Revision: 7412

Modified:
   jifty/trunk/lib/Jifty/Manual/Preload.pod
   jifty/trunk/lib/Jifty/Web/Form/Element.pm

Log:
preload => 1 generates a unique cache key

Modified: jifty/trunk/lib/Jifty/Manual/Preload.pod
==============================================================================
--- jifty/trunk/lib/Jifty/Manual/Preload.pod	(original)
+++ jifty/trunk/lib/Jifty/Manual/Preload.pod	Tue Aug 18 22:49:08 2009
@@ -85,6 +85,9 @@
 to preload that with the same cache key as regular votes. In fact, you probably
 do not want to preload it all if it's a rare occurrence.
 
+You may also pass a value of C<1> for the C<preload> key. This tells Jifty to
+generate a unique key for this preload so that you don't have to.
+
 Note that the C<$vote> action is submitted well after the next region has been
 preloaded!
 

Modified: jifty/trunk/lib/Jifty/Web/Form/Element.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form/Element.pm	(original)
+++ jifty/trunk/lib/Jifty/Web/Form/Element.pm	Tue Aug 18 22:49:08 2009
@@ -497,7 +497,11 @@
             $args{toggle} = 1 if $hook->{toggle};
 
             # Preloading functionality
-            $preload_key = $hook->{preload} if $hook->{preload};
+            if ($hook->{preload}) {
+                $preload_key = $hook->{preload} eq 1
+                             ? Jifty->web->serial
+                             : $hook->{preload};
+            }
 
             # Effects
             $args{$_} = $hook->{$_} for grep {exists $hook->{$_}} qw/effect effect_args remove_effect remove_effect_args/;


More information about the Jifty-commit mailing list