diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-08-25 19:42:33 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-08-26 03:31:14 -0500 |
commit | 77a5d9db83ac54980eccfa57735af1ed01ba702c (patch) | |
tree | 48c83500e193fb7e4606ab6ce22ac2282eff11c3 /app/assets/javascripts/commons | |
parent | b63c08b2638b01bdbb09ed26c9cce6f330f4a97e (diff) | |
download | gitlab-ce-77a5d9db83ac54980eccfa57735af1ed01ba702c.tar.gz |
add polyfill for NodeList.prototype.forEach (unsupported in Internet Explorer)
Diffstat (limited to 'app/assets/javascripts/commons')
-rw-r--r-- | app/assets/javascripts/commons/polyfills.js | 1 | ||||
-rw-r--r-- | app/assets/javascripts/commons/polyfills/nodelist.js | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/app/assets/javascripts/commons/polyfills.js b/app/assets/javascripts/commons/polyfills.js index bc3e741f524..b78089525cc 100644 --- a/app/assets/javascripts/commons/polyfills.js +++ b/app/assets/javascripts/commons/polyfills.js @@ -12,3 +12,4 @@ import 'core-js/fn/symbol'; // Browser polyfills import './polyfills/custom_event'; import './polyfills/element'; +import './polyfills/nodelist'; diff --git a/app/assets/javascripts/commons/polyfills/nodelist.js b/app/assets/javascripts/commons/polyfills/nodelist.js new file mode 100644 index 00000000000..3772c94b900 --- /dev/null +++ b/app/assets/javascripts/commons/polyfills/nodelist.js @@ -0,0 +1,7 @@ +if (window.NodeList && !NodeList.prototype.forEach) { + NodeList.prototype.forEach = function forEach(callback, thisArg = window) { + for (let i = 0; i < this.length; i += 1) { + callback.call(thisArg, this[i], i, this); + } + }; +} |