remove es6 from demos (#713)

This commit is contained in:
Elliott Marquez 2019-12-19 16:49:43 -08:00 committed by GitHub
parent 2e8166edc9
commit c1030175a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 60 additions and 56 deletions

View File

@ -159,14 +159,14 @@ limitations under the License.
<script>
document.querySelectorAll('style[data-pre]').forEach(function(e) {
const preId = e.dataset.pre;
const pre = document.querySelector('#' + preId);
var preId = e.dataset.pre;
var pre = document.querySelector('#' + preId);
if (pre) {
pre.innerText = e.innerText;
}
});
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -117,7 +117,7 @@ limitations under the License.
<demo-card></demo-card>
</div>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -46,7 +46,7 @@ limitations under the License.
</main>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -66,7 +66,7 @@ limitations under the License.
</main>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -158,25 +158,25 @@ limitations under the License.
</mwc-dialog>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
const buttons = document.body.querySelectorAll('mwc-button[data-num]');
var buttons = document.body.querySelectorAll('mwc-button[data-num]');
for (let i = 0; i < buttons.length; i++) {
const button = buttons[i];
const buttonNum = button.dataset.num;
for (var i = 0; i < buttons.length; i++) {
var button = buttons[i];
var buttonNum = button.dataset.num;
button.addEventListener('click', () => {
const dialog = document.body.querySelector('#dialog' + buttonNum);
button.addEventListener('click', function() {
var dialog = document.body.querySelector('#dialog' + buttonNum);
dialog.open = true;
});
}
toggleActions.onclick = () => {
const dialog = document.body.querySelector('#dialog4');
const hideActionSpan = document.body.querySelector('#hideActionVal');
toggleActions.onclick = function() {
var dialog = document.body.querySelector('#dialog4');
var hideActionSpan = document.body.querySelector('#hideActionVal');
const hideAction = !dialog.hideActions;
var hideAction = !dialog.hideActions;
dialog.hideActions = hideAction;
hideActionSpan.innerText = hideAction;
}

View File

@ -50,7 +50,7 @@ limitations under the License.
</main>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -1,5 +1,5 @@
const drawer = document.getElementsByTagName('mwc-drawer')[0];
const container = drawer.parentNode;
container.addEventListener('MDCTopAppBar:nav', (e) => {
var drawer = document.getElementsByTagName('mwc-drawer')[0];
var container = drawer.parentNode;
container.addEventListener('MDCTopAppBar:nav', function(e) {
drawer.open = !drawer.open;
});

View File

@ -49,7 +49,7 @@ limitations under the License.
</main>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -74,7 +74,7 @@ limitations under the License.
</main>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -59,10 +59,10 @@ limitations under the License.
</main>
<script type="module">
Array.from(document.querySelectorAll('mwc-icon-button-toggle')).forEach((e) => {
e.addEventListener('MDCIconButtonToggle:change', (e) => console.log(e.type, e.target));
Array.from(document.querySelectorAll('mwc-icon-button-toggle')).forEach(function(e) {
e.addEventListener('MDCIconButtonToggle:change', function(e) {console.log(e.type, e.target)});
});
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -50,7 +50,7 @@ limitations under the License.
</main>
<script type="module">
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -57,7 +57,7 @@ limitations under the License.
</main>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -61,11 +61,11 @@ limitations under the License.
</main>
<script>
toggle.onclick = (e) => {
toggle.onclick = function (e) {
progress1.closed = !progress1.closed;
}
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -68,7 +68,7 @@ limitations under the License.
<div class="demo-log" id="log"></div>
</main>
<script>
button.addEventListener('click', (e) => {
button.addEventListener('click', function (e) {
menu.setAnchorCorner(menu.Corner.BOTTOM_START);
menu.open = !menu.open;
})
@ -78,7 +78,7 @@ limitations under the License.
log.textContent = `selected: ${detail.index}, ${detail.item.label}`;
});
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -45,7 +45,7 @@ limitations under the License.
<mwc-radio id="b2" name="b" checked class="pink"></mwc-radio>
</main>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -70,7 +70,7 @@ limitations under the License.
</main>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -99,7 +99,7 @@ limitations under the License.
</mwc-select>
</main>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -71,12 +71,12 @@ limitations under the License.
function show(element, e) {
element.textContent = `Value from ${e.type}: ${e.detail.value}`;
}
Array.from(document.querySelectorAll('mwc-slider')).forEach((e) => {
e.addEventListener('MDCSlider:input', (e) => show(window.logInput, e));
e.addEventListener('MDCSlider:change', (e) => show(window.logChange, e));
Array.from(document.querySelectorAll('mwc-slider')).forEach(function(e) {
e.addEventListener('input', function(e) {show(window.logInput, e)});
e.addEventListener('change', function(e) {show(window.logChange, e)});
});
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -48,25 +48,25 @@ limitations under the License.
</main>
<script>
snack1.onclick = () => {
snack1.onclick = function() {
snack.stacked = false;
snack.leading = false;
snack.open();
}
snack2.onclick = () => {
snack2.onclick = function() {
snack.stacked = false;
snack.leading = true;
snack.open();
}
snack3.onclick = () => {
snack3.onclick = function() {
snack.stacked = true;
snack.leading = false;
snack.open();
}
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -41,7 +41,7 @@ limitations under the License.
</div>
</main>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -179,7 +179,7 @@ limitations under the License.
</main>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -64,7 +64,7 @@ limitations under the License.
</main>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -61,7 +61,7 @@ limitations under the License.
</main>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -92,7 +92,7 @@ limitations under the License.
</main>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -62,7 +62,7 @@ limitations under the License.
</div>
</main>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -64,7 +64,7 @@ limitations under the License.
</main>
<script>
addEventListener('load', () => document.body.classList.remove('unresolved'));
addEventListener('load', function() { document.body.classList.remove('unresolved'); });
</script>
</body>
</html>

View File

@ -36,10 +36,10 @@
</div>
</mwc-top-app-bar-fixed>
<script>
const flags = {};
var flags = {};
// from url
location.search.slice(1).split('&').forEach(function(option) {
const parts = option.split('=');
var parts = option.split('=');
bar[parts[0]] = parts[1] || true;
});
if (bar.prominent || bar.dense) {
@ -50,7 +50,9 @@
bar.classList.add('custom');
}
if (bar.centerTitle) {
for (const node of bar.querySelectorAll('.notCenter')) {
var nodes = bar.querySelectorAll('.notCenter');
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
bar.removeChild(node);
}
}

View File

@ -36,10 +36,10 @@
</div>
</mwc-top-app-bar>
<script>
const flags = {};
var flags = {};
// from url
location.search.slice(1).split('&').forEach(function(option) {
const parts = option.split('=');
var parts = option.split('=');
bar[parts[0]] = parts[1] || true;
});
if (bar.prominent || bar.dense) {
@ -50,7 +50,9 @@
bar.classList.add('custom');
}
if (bar.centerTitle) {
for (const node of bar.querySelectorAll('.notCenter')) {
var nodes = bar.querySelectorAll('.notCenter');
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
bar.removeChild(node);
}
}