client/misc: extract polyfills to separate file
This commit is contained in:
parent
d603fb3fe6
commit
fe5946b4b0
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
require('./util/polyfill.js');
|
||||||
require('./util/handlebars-helpers.js');
|
require('./util/handlebars-helpers.js');
|
||||||
|
|
||||||
let controllers = [];
|
let controllers = [];
|
||||||
|
|
|
@ -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 handlebars = require('handlebars');
|
||||||
const events = require('../events.js');
|
const events = require('../events.js');
|
||||||
const contentHolder = document.getElementById('content-holder');
|
const contentHolder = document.getElementById('content-holder');
|
||||||
|
require('../util/polyfill.js');
|
||||||
|
|
||||||
function messageHandler(message, className) {
|
function messageHandler(message, className) {
|
||||||
const messagesHolder = contentHolder.querySelector('.messages');
|
const messagesHolder = contentHolder.querySelector('.messages');
|
||||||
|
@ -21,9 +22,6 @@ function messageHandler(message, className) {
|
||||||
events.listen(events.Success, msg => { messageHandler(msg, 'success'); });
|
events.listen(events.Success, msg => { messageHandler(msg, 'success'); });
|
||||||
events.listen(events.Error, msg => { messageHandler(msg, 'error'); });
|
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 {
|
class BaseView {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.contentHolder = contentHolder;
|
this.contentHolder = contentHolder;
|
||||||
|
|
Loading…
Reference in New Issue