mirror of
https://github.com/material-components/material-web.git
synced 2024-10-27 14:07:17 +03:00
remove es6 from demos (#713)
This commit is contained in:
parent
2e8166edc9
commit
c1030175a0
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
});
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user