[Bps-public-commit] r19916 - RT-KeyBindings/html/KeyBindings

falcone at bestpractical.com falcone at bestpractical.com
Fri Jun 5 12:48:23 EDT 2009


Author: falcone
Date: Fri Jun  5 12:48:23 2009
New Revision: 19916

Modified:
   RT-KeyBindings/html/KeyBindings/Core.js

Log:
click() doesn't work on FF

Modified: RT-KeyBindings/html/KeyBindings/Core.js
==============================================================================
--- RT-KeyBindings/html/KeyBindings/Core.js	(original)
+++ RT-KeyBindings/html/KeyBindings/Core.js	Fri Jun  5 12:48:23 2009
@@ -25,7 +25,7 @@
     }
    else if (binding["action"] == "click") {
       var elements = document.getElementsByName(binding["data"]);
-       elements[0].click();
+       clickLink(elements[0])
     }
 
  }     
@@ -47,4 +47,11 @@
     return(bindings[key]);
 }
 
+function clickLink(linkobj) {
+    if (linkobj.getAttribute('onclick') == null) {
+        if (linkobj.getAttribute('href')) document.location = linkobj.getAttribute('href');
+    }
+    else linkobj.onclick();
+}
+
 %$m->abort();



More information about the Bps-public-commit mailing list