summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/extended/event.js
diff options
context:
space:
mode:
authorwei <>2006-01-16 02:43:30 +0000
committerwei <>2006-01-16 02:43:30 +0000
commitca47a8c7fd5eb9f34ac00a2f1a843859d6123dd8 (patch)
tree436215c674c4ef68335bf9b3cfe1387236d762ff /framework/Web/Javascripts/extended/event.js
parent2d6584b56f0c52686f868c4c7dafc44db0f7c5cf (diff)
Diffstat (limited to 'framework/Web/Javascripts/extended/event.js')
-rw-r--r--framework/Web/Javascripts/extended/event.js23
1 files changed, 22 insertions, 1 deletions
diff --git a/framework/Web/Javascripts/extended/event.js b/framework/Web/Javascripts/extended/event.js
index a7f58fae..4a35ba78 100644
--- a/framework/Web/Javascripts/extended/event.js
+++ b/framework/Web/Javascripts/extended/event.js
@@ -20,5 +20,26 @@ Object.extend(Event, {
name = 'keydown';
this._observeAndCache(element, name, observer, useCapture);
- }
+ },
+ keyCode : function(e)
+ {
+ return e.keyCode != null ? e.keyCode : e.charCode
+ },
+
+ fireEvent : function(el,type)
+ {
+ if(document.createEvent)
+ {
+ var evt = document.createEvent('HTMLEvents');
+ evt.initEvent(type, true, true);
+ el.dispatchEvent(evt);
+ }
+ else if(el.fireEvent)
+ {
+ el.fireEvent('on'+type);
+ el[type]();
+ }
+ else
+ el[type]();
+ }
}); \ No newline at end of file