Skip to content

Commit 0af120d

Browse files
authored
Try older Event for IE 11 (#1219)
* Try older Event for IE 11 Post #1216 * Declare identifier Post #1216 Auto-merge
1 parent 437f13a commit 0af120d

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

views/includes/scripts/searchBar.html

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@
3030
var container = target.closest('div.input-group');
3131
var inputNode = null;
3232
var buttonNode = null;
33-
var ev = new Event('input');
33+
var ev = null;
34+
try {
35+
ev = new Event('input');
36+
} catch (aE) {
37+
ev = document.createEvent('Event');
38+
ev.initEvent('input', true, true);
39+
}
3440

3541
if (container) {
3642
inputNode = container.querySelector('input[type=text].search');
@@ -52,7 +58,13 @@
5258
var i = null;
5359
var thisNode = null;
5460
var nodes = null;
55-
var ev = new Event('input');
61+
var ev = null;
62+
try {
63+
ev = new Event('input');
64+
} catch (aE) {
65+
ev = document.createEvent('Event');
66+
ev.initEvent('input', true, true);
67+
}
5668

5769
nodes = document.querySelectorAll('input[type=text].search');
5870
for (i = 0; thisNode = nodes[i++];) {

0 commit comments

Comments
 (0)