From 0226f8f5f430d34b3cead40c4eb7b458933d16c6 Mon Sep 17 00:00:00 2001 From: wei <> Date: Wed, 18 Jan 2006 04:20:26 +0000 Subject: update javascript library and usage in web controls --- framework/Web/Javascripts/extended/base.js | 2 +- framework/Web/Javascripts/extended/event.js | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'framework/Web/Javascripts/extended') diff --git a/framework/Web/Javascripts/extended/base.js b/framework/Web/Javascripts/extended/base.js index d3d8fb63..8975e1cc 100644 --- a/framework/Web/Javascripts/extended/base.js +++ b/framework/Web/Javascripts/extended/base.js @@ -29,7 +29,7 @@ function $(n,d) { Function.prototype.bindEvent = function() { var __method = this, args = $A(arguments), object = args.shift(); return function(event) { - return __method.call(object, [event || window.event].concat(args)); + return __method.apply(object, [event || window.event].concat(args)); } } diff --git a/framework/Web/Javascripts/extended/event.js b/framework/Web/Javascripts/extended/event.js index dd72d60e..a7514cda 100644 --- a/framework/Web/Javascripts/extended/event.js +++ b/framework/Web/Javascripts/extended/event.js @@ -16,7 +16,7 @@ Object.extend(Event, { if (name == 'keypress' && ((navigator.appVersion.indexOf('AppleWebKit') > 0) - || (element && element.attachEvent))) + || element.attachEvent)) name = 'keydown'; this._observeAndCache(element, name, observer, useCapture); @@ -26,20 +26,20 @@ Object.extend(Event, { return e.keyCode != null ? e.keyCode : e.charCode }, - fireEvent : function(el,type) + fireEvent : function(element,type) { if(document.createEvent) { - var evt = document.createEvent('HTMLEvents'); - evt.initEvent(type, true, true); - el.dispatchEvent(evt); + var event = document.createEvent('HTMLEvents'); + event.initEvent(type, true, true); + element.dispatchEvent(event); } - else if(el.fireEvent) + else if(element.fireEvent) { - el.fireEvent('on'+type); - el[type](); + element.fireEvent('on'+type); + element[type](); } else - el[type](); + element[type](); } }); \ No newline at end of file -- cgit v1.2.3