From 6d4823986ef758e972ea94f163c0fbc660f23012 Mon Sep 17 00:00:00 2001 From: Vincent Ogloblinsky Date: Mon, 15 Oct 2018 13:45:45 +0200 Subject: [PATCH] fix(menu): IE11 support fix #673 --- .../js/libs/custom-elements-es5-adapter.js | 15 + src/templates/page.hbs | 4 +- src/templates/partials/menu.hbs | 892 +++++++++--------- src/templates/partials/search-input.hbs | 4 +- 4 files changed, 488 insertions(+), 427 deletions(-) create mode 100644 src/resources/js/libs/custom-elements-es5-adapter.js diff --git a/src/resources/js/libs/custom-elements-es5-adapter.js b/src/resources/js/libs/custom-elements-es5-adapter.js new file mode 100644 index 00000000..3a694b8f --- /dev/null +++ b/src/resources/js/libs/custom-elements-es5-adapter.js @@ -0,0 +1,15 @@ +/** +@license @nocompile +Copyright (c) 2018 The Polymer Project Authors. All rights reserved. +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt +The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt +Code distributed by Google as part of the polymer project is also +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt +*/ +(function () { + 'use strict'; + + (function(){if(void 0===window.Reflect||void 0===window.customElements||window.customElements.hasOwnProperty('polyfillWrapFlushCallback'))return;const a=HTMLElement;window.HTMLElement=function(){return Reflect.construct(a,[],this.constructor)},HTMLElement.prototype=a.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,a);})(); + +}()); diff --git a/src/templates/page.hbs b/src/templates/page.hbs index 900eba60..4fec6c5e 100644 --- a/src/templates/page.hbs +++ b/src/templates/page.hbs @@ -155,7 +155,9 @@ - + + + diff --git a/src/templates/partials/menu.hbs b/src/templates/partials/menu.hbs index baf97bdd..94757cff 100644 --- a/src/templates/partials/menu.hbs +++ b/src/templates/partials/menu.hbs @@ -1,5 +1,12 @@ 'use strict'; +{{!-- ES6 source --}} +{{!-- after edition --}} +{{!-- need to be compiled to ES5 for IE11 support, and pasted below --}} +{{!-- https://babeljs.io/repl --}} +{{!-- or copy render function body below --}} + +{{!-- customElements.define('compodoc-menu', class extends HTMLElement { constructor() { super(); @@ -11,431 +18,470 @@ customElements.define('compodoc-menu', class extends HTMLElement { } render(isNormalMode) { - let tp = lithtml.html(`