diff --git a/client/js/main.js b/client/js/main.js index 03b73cc3..c5a22820 100644 --- a/client/js/main.js +++ b/client/js/main.js @@ -1,5 +1,6 @@ 'use strict'; +require('./util/polyfill.js'); require('./util/handlebars-helpers.js'); let controllers = []; diff --git a/client/js/util/polyfill.js b/client/js/util/polyfill.js new file mode 100644 index 00000000..1cd8e6f5 --- /dev/null +++ b/client/js/util/polyfill.js @@ -0,0 +1,4 @@ +'use strict'; + +// fix iterating over NodeList in Chrome and Opera +NodeList.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator]; diff --git a/client/js/views/base_view.js b/client/js/views/base_view.js index c5ed4657..9cfc76c8 100644 --- a/client/js/views/base_view.js +++ b/client/js/views/base_view.js @@ -3,6 +3,7 @@ const handlebars = require('handlebars'); const events = require('../events.js'); const contentHolder = document.getElementById('content-holder'); +require('../util/polyfill.js'); function messageHandler(message, className) { const messagesHolder = contentHolder.querySelector('.messages'); @@ -21,9 +22,6 @@ function messageHandler(message, className) { events.listen(events.Success, msg => { messageHandler(msg, 'success'); }); events.listen(events.Error, msg => { messageHandler(msg, 'error'); }); -// fix iterating over NodeList in Chrome and Opera -NodeList.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator]; - class BaseView { constructor() { this.contentHolder = contentHolder;