Skip to content

Commit

Permalink
new method interface
Browse files Browse the repository at this point in the history
  • Loading branch information
ackspony authored Feb 15, 2018
1 parent e0a4d58 commit 9936f1e
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h3>Configurable time example</h3>
<div id="race-1">
<h3>Overlapping / Race example #1</h3>
<p>
<button id="race-1-btn">"loadingOverlay().activate()" twice: 3 sec &amp; 5 sec</button>
<button id="race-1-btn">"loadingOverlay.activate()" twice: 3 sec &amp; 5 sec</button>
</p>
<small>
<p>Invokes "activate()" function 2 times successively, tracking each "spinHandle" respectively. </p>
Expand All @@ -81,7 +81,7 @@ <h3>Overlapping / Race example #1</h3>
<div id="race-2">
<h3>Overlapping / Race example #2</h3>
<p>
<button id="race-2-btn">"loadingOverlay().activate()" twice: 5 sec &amp; 3 sec</button>
<button id="race-2-btn">"loadingOverlay.activate()" twice: 5 sec &amp; 3 sec</button>
</p>
<small>
<p>Invokes "activate()" function 2 times successively, tracking each "spinHandle" respectively. </p>
Expand Down Expand Up @@ -137,9 +137,9 @@ <h3>Overlapping / Race example #2</h3>
(function() {
var show3SecondsBtn = document.getElementById('show-3-seconds-btn');
show3SecondsBtn.onclick = function() {
var spinHandle = loadingOverlay().activate();
var spinHandle = loadingOverlay.activate();
setTimeout(function() {
loadingOverlay().cancel(spinHandle);
loadingOverlay.cancel(spinHandle);
}, 3000);
return false;
};
Expand All @@ -151,9 +151,9 @@ <h3>Overlapping / Race example #2</h3>
var showNSecondsForm = document.getElementById('show-n-seconds-form');
showNSecondsForm.onsubmit = function() {
var msTimeout = parseInt(document.getElementById('show-n-seconds-number').value) * 1000;
var spinHandle = loadingOverlay().activate();
var spinHandle = loadingOverlay.activate();
setTimeout(function() {
loadingOverlay().cancel(spinHandle);
loadingOverlay.cancel(spinHandle);
}, msTimeout);
return false;
};
Expand All @@ -164,13 +164,13 @@ <h3>Overlapping / Race example #2</h3>
(function() {
var race1Btn = document.getElementById('race-1-btn');
race1Btn.onclick = function() {
var spinHandle1 = loadingOverlay().activate();
var spinHandle2 = loadingOverlay().activate();
var spinHandle1 = loadingOverlay.activate();
var spinHandle2 = loadingOverlay.activate();
setTimeout(function() {
loadingOverlay().cancel(spinHandle1);
loadingOverlay.cancel(spinHandle1);
}, 3000);
setTimeout(function() {
loadingOverlay().cancel(spinHandle2);
loadingOverlay.cancel(spinHandle2);
}, 5000);
document.getElementById('race-1-spin-handle-1').value = spinHandle1;
document.getElementById('race-1-spin-handle-2').value = spinHandle2;
Expand All @@ -183,13 +183,13 @@ <h3>Overlapping / Race example #2</h3>
(function() {
var race2Btn = document.getElementById('race-2-btn');
race2Btn.onclick = function() {
var spinHandle1 = loadingOverlay().activate();
var spinHandle2 = loadingOverlay().activate();
var spinHandle1 = loadingOverlay.activate();
var spinHandle2 = loadingOverlay.activate();
setTimeout(function() {
loadingOverlay().cancel(spinHandle1);
loadingOverlay.cancel(spinHandle1);
}, 5000);
setTimeout(function() {
loadingOverlay().cancel(spinHandle2);
loadingOverlay.cancel(spinHandle2);
}, 3000);
document.getElementById('race-2-spin-handle-1').value = spinHandle1;
document.getElementById('race-2-spin-handle-2').value = spinHandle2;
Expand All @@ -199,4 +199,4 @@ <h3>Overlapping / Race example #2</h3>
</script>
</body>

</html>
</html>

0 comments on commit 9936f1e

Please sign in to comment.