Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks IE11 (which is supported by docsify v4) #6

Closed
jhildenbiddle opened this issue Jun 14, 2020 · 3 comments · Fixed by #7
Closed

Breaks IE11 (which is supported by docsify v4) #6

jhildenbiddle opened this issue Jun 14, 2020 · 3 comments · Fixed by #7
Labels
bug Something isn't working

Comments

@jhildenbiddle
Copy link

jhildenbiddle commented Jun 14, 2020

This plugin is using ES2015 method definition shorthand syntax which is not supported by IE11:

injectCodeFundContainer() {
if (document.getElementById("codefund") === null) {
let nav = document.getElementsByClassName('sidebar-nav');
let codefundContainer = document.createElement('div');
codefundContainer.id = 'codefund';
nav[0].insertBefore(codefundContainer, nav[0].firstChild);
}
if (document.getElementsByClassName('cf-wrapper').length === 0) {
window._codefund && window._codefund.serve();
}
},

Since IE11 is officially support by docsify, docsify plugins should be authored using only ES5 or transpiled from ES6+ to ES5 using a tool like Babel. This plugin is used on docsify.js.org which fails to load properly in IE11 as a result of this issue.

Thanks!

@jhildenbiddle jhildenbiddle changed the title Breaks IE11 Breaks IE11 (which is supported by docsify v4) Jun 14, 2020
@njleonzhang njleonzhang added the bug Something isn't working label Jun 15, 2020
@kirbyfern
Copy link
Contributor

kirbyfern commented Jun 23, 2020

Since method definitions are not valid in IE11, it should be

    injectCodeFundContainer: function() {
      if (document.getElementById("codefund") === null) {
        let nav = document.getElementsByClassName('sidebar-nav');
        let codefundContainer = document.createElement('div');
        codefundContainer.id = 'codefund';
        nav[0].insertBefore(codefundContainer, nav[0].firstChild);
      }
      
      if (document.getElementsByClassName('cf-wrapper').length === 0) {
        window._codefund && window._codefund.serve();
      }
    },

Made a PR at #7.

@njleonzhang
Copy link
Owner

fixed in newest version, thanks

@jhildenbiddle
Copy link
Author

Thanks @njleonzhang!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants