From 215869f3e4db806ac2c019590d2c11d3ee448424 Mon Sep 17 00:00:00 2001 From: Eric Bidelman Date: Mon, 6 Apr 2015 14:35:03 -0700 Subject: [PATCH] Demo working under polyfill --- demo.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/demo.html b/demo.html index 397ebcd..cf5cfbf 100644 --- a/demo.html +++ b/demo.html @@ -30,7 +30,10 @@ var selector = document.querySelector('#selector'); var input = document.querySelector('#input'); - I18nMsg.lang = selector.value || document.documentElement.lang || 'en'; + // Event is only needed when running under the HTMLImports polyfill. + document.addEventListener('HTMLImportsLoaded', function() { + I18nMsg.lang = selector.value || document.documentElement.lang || 'en'; + }); selector.addEventListener('change', function() { document.documentElement.lang = this.value;