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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
d329cf4f
Commit
d329cf4f
authored
Sep 11, 2017
by
Filipa Lacerda
Committed by
Phil Hughes
Sep 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds Event polyfill for IE
parent
f9b30c6d
Changes
4
Show 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 @
d329cf4f
...
@@ -12,4 +12,5 @@ import 'core-js/fn/symbol';
...
@@ -12,4 +12,5 @@ import 'core-js/fn/symbol';
// Browser polyfills
// Browser polyfills
import
'
./polyfills/custom_event
'
;
import
'
./polyfills/custom_event
'
;
import
'
./polyfills/element
'
;
import
'
./polyfills/element
'
;
import
'
./polyfills/event
'
;
import
'
./polyfills/nodelist
'
;
import
'
./polyfills/nodelist
'
;
app/assets/javascripts/commons/polyfills/custom_event.js
View file @
d329cf4f
if
(
typeof
window
.
CustomEvent
!==
'
function
'
)
{
if
(
typeof
window
.
CustomEvent
!==
'
function
'
)
{
window
.
CustomEvent
=
function
CustomEvent
(
event
,
params
)
{
window
.
CustomEvent
=
function
CustomEvent
(
event
,
params
)
{
const
evt
=
document
.
createEvent
(
'
CustomEvent
'
);
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
);
evt
.
initCustomEvent
(
event
,
evtParams
.
bubbles
,
evtParams
.
cancelable
,
evtParams
.
detail
);
return
evt
;
return
evt
;
};
};
...
...
app/assets/javascripts/commons/polyfills/event.js
0 → 100644
View file @
d329cf4f
/**
* 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 @
d329cf4f
---
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