summaryrefslogtreecommitdiff
path: root/roundcubemail/program/js/common.js
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-02-12 19:54:16 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-02-12 19:54:16 +0000
commit2bae1d1f79f099f0e5cff7964eb96b4e6c3482d3 (patch)
tree77507bf9f7adeb8b0996498fc17beb13cab41c47 /roundcubemail/program/js/common.js
parent07a3f6e51f27c802a30f7e9de703e472c0832f99 (diff)
Make script cross browser compatible
git-svn-id: https://svn.roundcube.net/trunk@1055 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js/common.js')
-rw-r--r--roundcubemail/program/js/common.js25
1 files changed, 17 insertions, 8 deletions
diff --git a/roundcubemail/program/js/common.js b/roundcubemail/program/js/common.js
index 6435f3b77..860ca3e07 100644
--- a/roundcubemail/program/js/common.js
+++ b/roundcubemail/program/js/common.js
@@ -95,14 +95,23 @@ function roundcube_browser()
// static functions for event handling
var rcube_event = {
- /**
- * returns the event key code
- */
- get_keycode: function(e)
- {
- e = e || window.event;
- return e && e.keyCode ? e.keyCode : (e && e.which ? e.which : 0);
- },
+/**
+ * returns the event target element
+ */
+get_target: function(e)
+{
+ e = e || window.event;
+ return e && e.target ? e.target : e.srcElement;
+},
+
+/**
+ * returns the event key code
+ */
+get_keycode: function(e)
+{
+ e = e || window.event;
+ return e && e.keyCode ? e.keyCode : (e && e.which ? e.which : 0);
+},
/**
* returns modifier key (constants defined at top of file)