]> jaekl.net Git - quanweb.git/commitdiff
Add a bottom slider.
authorChris Jaekl <cejaekl@yahoo.com>
Sat, 11 Aug 2018 02:29:17 +0000 (22:29 -0400)
committerChris Jaekl <cejaekl@yahoo.com>
Sat, 11 Aug 2018 02:29:17 +0000 (22:29 -0400)
I'm not happy with this; it works, but it seems a bit of a kludge.
Need to think about how to refactor this to properly listen-notify with multiple pagers.

app/index.html
js/src/BooksView.js
js/src/PagingController.js
js/src/SearchController.js

index d2c48d93a288c24c482f0efd58ff876b893f9ee1..d26603de1ae54f166a7ea47813a319aa6a6d18ca 100644 (file)
 
     <div id="details" class="tooltip" onclick="hideDetails();">(No information available)</div>
 
+    <div class="pager">
+      <input id="bottom_back" onclick="onPrev();" value="Back" type="button"/>
+      <input id="bottom_forward" onclick="onNext();" value="Forward" type="button"/>
+      <input id="bottom_slider" onchange="onSlide(this.value);" min="0" max="0" type="range" value="0"/>
+      Showing <span id="bottom_first">0</span> through <span id="bottom_last">0</span> out of <span id="bottom_count">0</span> matching books.
+    </div>
+
     <script src="modernizr-custom.js"></script>
     <script src="lib.min.js"></script>
   </body>
index 0259edd5473c87b3d870f503e4ee15deb892318f..05a315f9825fad13816d3f2be0b2eb27e66c0a09 100644 (file)
@@ -29,8 +29,11 @@ var BooksView = (function() {
     
         Browser.getElementById('books').innerHTML = html;
         Browser.getElementById('first').innerHTML = (BooksModel.first + 1);
+        Browser.getElementById('bottom_first').innerHTML = (BooksModel.first + 1);
         Browser.getElementById('last').innerHTML = (BooksModel.last + 1);
+        Browser.getElementById('bottom_last').innerHTML = (BooksModel.last + 1);
         Browser.getElementById('count').innerHTML = BooksModel.count;
+        Browser.getElementById('bottom_count').innerHTML = BooksModel.count;
     };
     
     // ===============
index c043dc1bcdc85e422315c15dcb118f8444e554c8..0918f54ce226de6a656e3720dda1b281d2542c48 100644 (file)
@@ -27,6 +27,7 @@ var PagingController = (function() {
     
     my.notify = function() {
         Browser.getElementById('slider').value = booksModel.first;
+        Browser.getElementById('bottom_slider').value = booksModel.first;
     };
 
     return my;
index 0f131945bacbf56f2ac59cdcc1db7a96262590b7..54d76fab8edbf15af907a5af8b3959ff46db7609 100644 (file)
@@ -31,6 +31,8 @@ var SearchController = (function () {
         
                 var elem = Browser.getElementById('slider');
                 elem.max = booksModel.count;
+                elem = Browser.getElementById('bottom_slider');
+                elem.max = booksModel.count;
         
                 PagingController.adjustPos(0);
             })