Skip to content

Commit 2da9931

Browse files
authored
Merge pull request #312 from Lctrs/fix-registering-custom-elements
[Js] Fix registering custom elements
2 parents 09dc432 + 42f9bc0 commit 2da9931

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Resources/public/js/editInPlace.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@
66
* For the full copyright and license information, please view the LICENSE
77
* file that was distributed with this source code.
88
*/
9-
document.registerElement('x-trans', { prototype: Object.create(HTMLElement.prototype) });
9+
(function () {
10+
if (typeof customElements.define !== "undefined") {
11+
customElements.define("x-trans", HTMLElement);
12+
13+
return;
14+
}
15+
16+
document.registerElement("x-trans", {
17+
prototype: Object.create(HTMLElement.prototype)
18+
});
19+
})();
1020

1121
/**
1222
* TranslationBundleEditInPlace boot the ContentTools editor and handle saves.

0 commit comments

Comments
 (0)