Giter VIP home page Giter VIP logo

Comments (1)

raygit83 avatar raygit83 commented on May 24, 2024

Here are the changes required to facilitate IE11 support:

  1. 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.

  1. 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.

from cms.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.