client/misc: extract polyfills to separate file
This commit is contained in:
parent
d603fb3fe6
commit
fe5946b4b0
3 changed files with 6 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
require('./util/polyfill.js');
|
||||
require('./util/handlebars-helpers.js');
|
||||
|
||||
let controllers = [];
|
||||
|
|
4
client/js/util/polyfill.js
Normal file
4
client/js/util/polyfill.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
'use strict';
|
||||
|
||||
// fix iterating over NodeList in Chrome and Opera
|
||||
NodeList.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue