add snippet code samples to laoding component page

master
Marc Cohen 2015-07-02 14:10:51 +01:00
parent ee4a1c1e2e
commit b6f6c4b6c1
8 changed files with 30 additions and 38 deletions

View File

@ -177,9 +177,23 @@ categories:
- name: progress
caption: Progress bar
class: mdl-progress
snippets:
- snippet_group:
- caption: Default
file: progress-default.html
- caption: Indeterminate
file: progress-indeterminate.html
- caption: Buffering
file: progress-buffering.html
- name: spinner
caption: Spinner
class: mdl-spinner
snippets:
- snippet_group:
- caption: Default
file: spinner-default.html
- caption: Single color
file: spinner-single-color.html
- name: menus
title: Menus
description: Lists of clickable actions.

View File

@ -1,26 +0,0 @@
<div class="demo-preview-block">
<p>
Default:
<div id="p1" class="mdl-progress mdl-js-progress"></div>
</p>
<p>
Indeterminate:
<div id="p2" class="mdl-progress mdl-js-progress mdl-progress__indeterminate"></div>
</p>
<p>
Buffering:
<div id="p3" class="mdl-progress mdl-js-progress"></div>
</p>
</div>
<script>
document.querySelector('#p1').addEventListener('mdl-componentupgraded', function() {
this.MaterialProgress.setProgress(44);
});
document.querySelector('#p3').addEventListener('mdl-componentupgraded', function() {
this.MaterialProgress.setProgress(33);
this.MaterialProgress.setBuffer(87);
});
</script>

View File

@ -0,0 +1,7 @@
<div id="p3" class="mdl-progress mdl-js-progress"></div>
<script>
document.querySelector('#p3').addEventListener('mdl-componentupgraded', function() {
this.MaterialProgress.setProgress(33);
this.MaterialProgress.setBuffer(87);
});
</script>

View File

@ -0,0 +1,6 @@
<div id="p1" class="mdl-progress mdl-js-progress"></div>
<script>
document.querySelector('#p1').addEventListener('mdl-componentupgraded', function() {
this.MaterialProgress.setProgress(44);
});
</script>

View File

@ -0,0 +1 @@
<div id="p2" class="mdl-progress mdl-js-progress mdl-progress__indeterminate"></div>

View File

@ -1,12 +0,0 @@
<div class="demo-preview-block">
<p>
Default:
<div class="mdl-spinner mdl-js-spinner is-active"></div>
</p>
<p>
Single color (uses primary palette):
<div class="mdl-spinner mdl-spinner--single-color mdl-js-spinner is-active"></div>
</p>
</div>

View File

@ -0,0 +1 @@
<div class="mdl-spinner mdl-js-spinner is-active"></div>

View File

@ -0,0 +1 @@
<div class="mdl-spinner mdl-spinner--single-color mdl-js-spinner is-active"></div>