Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
b1fc5859
Commit
b1fc5859
authored
Sep 11, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ie-event-polyfill' into 'master'
Adds Event polyfill for IE Closes #37633 See merge request !14159
parents
f9b30c6d
d329cf4f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
1 deletion
+30
-1
app/assets/javascripts/commons/polyfills.js
app/assets/javascripts/commons/polyfills.js
+1
-0
app/assets/javascripts/commons/polyfills/custom_event.js
app/assets/javascripts/commons/polyfills/custom_event.js
+6
-1
app/assets/javascripts/commons/polyfills/event.js
app/assets/javascripts/commons/polyfills/event.js
+18
-0
changelogs/unreleased/ie-event-polyfill.yml
changelogs/unreleased/ie-event-polyfill.yml
+5
-0
No files found.
app/assets/javascripts/commons/polyfills.js
View file @
b1fc5859
...
...
@@ -12,4 +12,5 @@ import 'core-js/fn/symbol';
// Browser polyfills
import
'
./polyfills/custom_event
'
;
import
'
./polyfills/element
'
;
import
'
./polyfills/event
'
;
import
'
./polyfills/nodelist
'
;
app/assets/javascripts/commons/polyfills/custom_event.js
View file @
b1fc5859
if
(
typeof
window
.
CustomEvent
!==
'
function
'
)
{
window
.
CustomEvent
=
function
CustomEvent
(
event
,
params
)
{
const
evt
=
document
.
createEvent
(
'
CustomEvent
'
);
const
evtParams
=
params
||
{
bubbles
:
false
,
cancelable
:
false
,
detail
:
undefined
};
const
evtParams
=
{
bubbles
:
false
,
cancelable
:
false
,
detail
:
undefined
,
...
params
,
};
evt
.
initCustomEvent
(
event
,
evtParams
.
bubbles
,
evtParams
.
cancelable
,
evtParams
.
detail
);
return
evt
;
};
...
...
app/assets/javascripts/commons/polyfills/event.js
0 → 100644
View file @
b1fc5859
/**
* Polyfill for IE11 support.
* new Event() is not supported by IE11.
* Although `initEvent` is deprecated for modern browsers it is the one supported by IE
*/
if
(
typeof
window
.
Event
!==
'
function
'
)
{
window
.
Event
=
function
Event
(
event
,
params
)
{
const
evt
=
document
.
createEvent
(
'
Event
'
);
const
evtParams
=
{
bubbles
:
false
,
cancelable
:
false
,
...
params
,
};
evt
.
initEvent
(
event
,
evtParams
.
bubbles
,
evtParams
.
cancelable
);
return
evt
;
};
window
.
Event
.
prototype
=
Event
;
}
changelogs/unreleased/ie-event-polyfill.yml
0 → 100644
View file @
b1fc5859
---
title
:
Adds Event polyfill for IE11
merge_request
:
author
:
type
:
fixed
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment