From 6572641f3d1dd1638640dc83b43e5862bd71554a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Oddsson?= Date: Fri, 9 Mar 2018 15:10:12 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=8Dcheck=20if=20``=20i?= =?UTF-8?q?s=20defined=20before=20registering?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/local-time-element.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/local-time-element.js b/src/local-time-element.js index 6c06ec9..2e81041 100644 --- a/src/local-time-element.js +++ b/src/local-time-element.js @@ -119,5 +119,7 @@ function formatTime(el) { // var time = new LocalTimeElement() // # => // -window.LocalTimeElement = LocalTimeElement -window.customElements.define('local-time', LocalTimeElement) +if (!window.customElements.get('local-time')) { + window.LocalTimeElement = LocalTimeElement + window.customElements.define('local-time', LocalTimeElement) +}