IE11 support / Object.assign()
Any chance to see an IE11 patch which apparently doesn't support Object.assign() ?
Thanks.
Here are the changes required to facilitate IE11 support:
- Add a polyfill for Object.assign(), e.g. right before
this.init()on the bottom of CMS.js:
"function"!=typeof Object.assign&&(Object.assign=function(n,t){"use strict";if(null==n)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(n),e=1;e<arguments.length;e++){var o=arguments[e];if(null!=o)for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&(r[c]=o[c])}return r});
The ES5 polyfills pulled in via the example pages' html do not include a Object.assign() implementation btw.
- Use a different means to trigger a hashchange event in this.init():
Replace
window.dispatchEvent(new HashChangeEvent('hashchange'));
by the following snippet
try {
window.dispatchEvent(new HashChangeEvent('hashchange'));
}
catch(e) {
window.location.hash = window.location.hash;
}
In IE new HashChangeEvent results in "Undefined property: HashChangeEvent." and window.location.hash = window.location.hash; won't trigger a hashchange event in e.g. Chrome, so keeping the old code in a try block seems to be a good idea.