diff options
author | thomascube <thomas@roundcube.net> | 2008-02-12 19:54:16 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2008-02-12 19:54:16 +0000 |
commit | a0ce2f0fa1873e45359d58e8c64e49fd80d9a692 (patch) | |
tree | 140191e41dabfa0ba02a5ad2c41a3d96c2e17e34 /program/js/common.js | |
parent | a9a8ef2b5c39d340043a423be71bf38faef567c2 (diff) |
Make script cross browser compatible
Diffstat (limited to 'program/js/common.js')
-rw-r--r-- | program/js/common.js | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/program/js/common.js b/program/js/common.js index 6435f3b77..860ca3e07 100644 --- a/program/js/common.js +++ b/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) |