[Jifty-commit] r3425 - in jifty/trunk: share/web/static/js

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sun Jun 10 02:05:48 EDT 2007


Author: clkao
Date: Sun Jun 10 02:05:48 2007
New Revision: 3425

Modified:
   jifty/trunk/lib/Jifty/Plugin/SkeletonApp/View.pm
   jifty/trunk/share/web/static/js/key_bindings.js

Log:
when rendering the keybindings div, reset Jifty.KeyBindings.
Ideally we might want to keep the state with the div so it resets
itself when replaced.


Modified: jifty/trunk/lib/Jifty/Plugin/SkeletonApp/View.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/SkeletonApp/View.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin/SkeletonApp/View.pm	Sun Jun 10 02:05:48 2007
@@ -67,7 +67,8 @@
 };
 
 private template 'keybindings' => sub {
-    div { id is "keybindings" };
+    div { id is "keybindings";
+      outs_raw('<script type="text/javascript"><!-- Jifty.KeyBindings.reset() --></script>') };
 };
 
 #template 'index.html' => page { { title is _('Welcome to your new Jifty application') } img { src is "/static/images/pony.jpg", alt is _( 'You said you wanted a pony. (Source %1)', 'http://hdl.loc.gov/loc.pnp/cph.3c13461'); }; };

Modified: jifty/trunk/share/web/static/js/key_bindings.js
==============================================================================
--- jifty/trunk/share/web/static/js/key_bindings.js	(original)
+++ jifty/trunk/share/web/static/js/key_bindings.js	Sun Jun 10 02:05:48 2007
@@ -24,6 +24,10 @@
         DOM.Events.removeListener(Jifty.KeyBindings.listener);
     },
 
+    reset: function() {
+        Jifty.KeyBindings.bindings = new Array();
+    },
+
     doClick: function(e) {
         if (e.target.nodeType == 3) // defeat Safari bug
             e.target = e.target.parentNode;


More information about the Jifty-commit mailing list