client/misc: extract polyfills to separate file

This commit is contained in:
rr- 2016-04-07 21:12:59 +02:00
parent d603fb3fe6
commit fe5946b4b0
3 changed files with 6 additions and 3 deletions

View file

@ -1,5 +1,6 @@
'use strict';
require('./util/polyfill.js');
require('./util/handlebars-helpers.js');
let controllers = [];

View file

@ -0,0 +1,4 @@
'use strict';
// fix iterating over NodeList in Chrome and Opera
NodeList.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];

View file

@ -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;