From 12f87a77a7d8b213de9d6c7402d6e3e20e39bf7c Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Tue, 7 Aug 2007 19:33:37 +0000 Subject: [PATCH] prototype: We can just use HTMLEvents in every non-IE browser instead of special-casing for Safari 2 --- src/event.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/event.js b/src/event.js index 0c209e5..22fdbc6 100644 --- a/src/event.js +++ b/src/event.js @@ -99,14 +99,7 @@ Event.extend = (function() { }; } else { - if(!Event.prototype) try { - Event.prototype = document.createEvent("Events").__proto__; - } catch(e) { - return function(event) { - if (event._extendedByPrototype) return event; - return Object.extend(event, methods); - }; - } + Event.prototype = Event.prototype || document.createEvent("HTMLEvents").__proto__; Object.extend(Event.prototype, methods); return Prototype.K; } @@ -219,11 +212,7 @@ Object.extend(Event, (function() { element = document.documentElement; if (document.createEvent) { - try { - var event = document.createEvent("Events"); - } catch(e) { - var event = document.createEvent("UIEvents"); - } + var event = document.createEvent("HTMLEvents"); event.initEvent("dataavailable", true, true); } else { var event = document.createEventObject();