diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2016-04-02 10:58:55 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2016-04-02 10:58:55 +0200 |
| commit | a91c4670de5516750a482860c73ca8ac835e6831 (patch) | |
| tree | 6413df348341b8105a2d43c0fc1911e06f785cbe /index.html | |
| parent | bc373a453948815b2707e6ae67e7bb40e169bec6 (diff) | |
| download | vortrag-knn-a91c4670de5516750a482860c73ca8ac835e6831.tar.gz vortrag-knn-a91c4670de5516750a482860c73ca8ac835e6831.zip | |
that was close - add weightsVisWrapperWrapper and fix reloading page inits
Diffstat (limited to 'index.html')
| -rw-r--r-- | index.html | 44 |
1 files changed, 17 insertions, 27 deletions
@@ -22,7 +22,7 @@ impress().init(); d3.selectAll(".visContainer")[0].forEach(function(el) { - weightsWrapper.addPlaceholder(d3.select(el)); + weightsWrapper.addPlaceholder(el.parentNode); }); weightsWrapper.load("data/weights.json", function() { weightsWrapper.reposition(); @@ -30,12 +30,12 @@ sizeSlides(); }, false); + /* responsive deck */ function sizeSlides() { d3.selectAll(".slide") .style("width", parseInt(window.innerWidth) * 0.9 + "px") .style("height", parseInt(window.innerHeight) * 0.9 + "px"); }; - window.addEventListener("resize", sizeSlides); </script> @@ -52,22 +52,17 @@ <h2>Die Gewichte im Verlauf</h2> </div> - <div class="visContainer" style="width: 100%; height: 100%"> - </div> + <div class="visContainer"></div> <script type="text/javascript"> - (function() { - var thisStep = document.currentScript.parentElement; - document.addEventListener("impress:stepenter", function(e) { - if (!weightsWrapper.ready || e.target != thisStep) return; - weightsWrapper.openIn(d3.select(thisStep).select(".visContainer")); + new VisIntegrater(function(c) { + weightsWrapper.afterLoad(function() { + weightsWrapper.openIn(c); weightsWrapper.animate(10, 10); }); - document.addEventListener("impress:stepleave", function(e) { - if (e.target != thisStep) return; - weightsWrapper.remove(d3.select(thisStep).select(".visContainer")); - }); - }()); + }, function(c) { + weightsWrapper.remove(c); + }); </script> </div> @@ -76,22 +71,17 @@ <h2>Gewichte und Fehler</h2> </div> - <div class="visContainer" style="width: 100%; height: 100%"> - </div> + <div class="visContainer"></div> <script type="text/javascript"> - (function() { - var thisStep = document.currentScript.parentElement; - document.addEventListener("impress:stepenter", function(e) { - if (!weightsWrapper.ready || e.target != thisStep) return; - weightsWrapper.openIn(d3.select(thisStep).select(".visContainer")); - weightsWrapper.animate(60, 1); - }); - document.addEventListener("impress:stepleave", function(e) { - if (e.target != thisStep) return; - weightsWrapper.remove(d3.select(thisStep).select(".visContainer")); + new VisIntegrater(function(c) { + weightsWrapper.afterLoad(function() { + weightsWrapper.openIn(c); + weightsWrapper.animate(10, 10); }); - }()); + }, function(c) { + weightsWrapper.remove(c); + }); </script> </div> </div> |
