Browse Source

Add a temporary shim for NodeList.forEach on firefox

spaghetti 8 years ago
parent
commit
53b4e6d92d
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      static/functions/global.js

+ 6
- 0
static/functions/global.js View File

@@ -201,6 +201,12 @@ function ungetCover(event) {
201 201
   coverCont.style.display = 'none'
202 202
 }
203 203
 
204
+// Apparently firefox doesn't implement NodeList.forEach until FF50
205
+// Remove this shim awter that's stable for a while
206
+if (typeof NodeList.prototype.forEach !== 'function') {
207
+  NodeList.prototype.forEach = Array.prototype.forEach
208
+}
209
+
204 210
 $(function() {
205 211
   if ($('#header_links_menu').length > 0) {
206 212
     $('#header_links_menu')[0].addEventListener('click', toggle_header_links)

Loading…
Cancel
Save