From 486aeadf01fedab8853fd515c88116282185f58d Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Thu, 22 Nov 2018 10:14:33 +0100 Subject: [PATCH] chore: remove old code for IE9 --- lib/web/varien/js.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/web/varien/js.js b/lib/web/varien/js.js index 55e41a1652cb8..45032829f2fd8 100644 --- a/lib/web/varien/js.js +++ b/lib/web/varien/js.js @@ -607,17 +607,11 @@ if (!("console" in window) || !("firebug" in console)) * @example fireEvent($('my-input', 'click')); */ function fireEvent(element, event) { - if (document.createEvent) { - // dispatch for all browsers except IE before version 9 - var evt = document.createEvent('HTMLEvents'); + // dispatch event + var evt = document.createEvent('HTMLEvents'); - evt.initEvent(event, true, true); // event type, bubbling, cancelable - return element.dispatchEvent(evt); - } - // dispatch for IE before version 9 - var evt = document.createEventObject(); - - return element.fireEvent('on' + event, evt); + evt.initEvent(event, true, true); // event type, bubbling, cancelable + return element.dispatchEvent(evt); }