Skip to content
This repository was archived by the owner on Jan 4, 2021. It is now read-only.

Commit 111fc6a

Browse files
author
Francois-Xavier Gentilhomme
committed
[FIX] fixes demo/index.html
1 parent c8abdc2 commit 111fc6a

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

demo/index.html

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@
7373
</template>
7474
</body>
7575
<script>
76-
function select(lang) {
77-
var myscriptTextWebElement = document.querySelector('myscript-text-web');
76+
window.addEventListener("load", function (event) {
77+
function select(lang) {
78+
var myscriptTextWebElement = document.querySelector('myscript-text-web');
79+
80+
myscriptTextWebElement.unloaded = true;
81+
myscriptTextWebElement.language = lang;
82+
myscriptTextWebElement.unloaded = false;
83+
}
7884

79-
myscriptTextWebElement.unloaded = true;
80-
myscriptTextWebElement.language = lang;
81-
myscriptTextWebElement.unloaded = false;
82-
}
83-
(function (document) {
84-
'use strict';
8585
var template = document.querySelector('#app');
8686
template.addEventListener('template-bound', function () {
8787
console.log('Our app is ready to rock!');
@@ -97,13 +97,10 @@
9797
var waitingDiv = document.querySelector('#waiting');
9898
waitingDiv.parentNode.removeChild(waitingDiv);
9999
console.log("All resources finished loading! Starting to init myscript-text-web");
100-
var myscriptTextWebElement = document.querySelector('myscript-text-web');
101-
myscriptTextWebElement.language = 'fr_FR';
102-
myscriptTextWebElement.unloaded = false;
100+
select('fr_FR');
103101
console.log("myscript-text-web should be displayed");
104102
}, 3000);
105103
});
106-
107-
})(document);
104+
});
108105
</script>
109106
</html>

0 commit comments

Comments
 (0)