From 42f9bc0c6e06a7b908d3262f45210d81228a5ef7 Mon Sep 17 00:00:00 2001 From: Lctrs Date: Wed, 26 Jun 2019 11:19:25 +0200 Subject: [PATCH] [Js] Fix registering custom elements --- Resources/public/js/editInPlace.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Resources/public/js/editInPlace.js b/Resources/public/js/editInPlace.js index b59bd753..dc16e48c 100644 --- a/Resources/public/js/editInPlace.js +++ b/Resources/public/js/editInPlace.js @@ -6,7 +6,17 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -document.registerElement('x-trans', { prototype: Object.create(HTMLElement.prototype) }); +(function () { + if (typeof customElements.define !== "undefined") { + customElements.define("x-trans", HTMLElement); + + return; + } + + document.registerElement("x-trans", { + prototype: Object.create(HTMLElement.prototype) + }); +})(); /** * TranslationBundleEditInPlace boot the ContentTools editor and handle saves.