diff options
author | Arun Persaud <arun@nubati.net> | 2012-10-06 00:19:12 -0700 |
---|---|---|
committer | Arun Persaud <arun@nubati.net> | 2012-10-06 00:19:12 -0700 |
commit | 293b20963f2bbf0cfca1a146506d65d615b01c2c (patch) | |
tree | 6bc70a842bd4ba68a28645de1b2b85f3d8c68dad /js | |
parent | 494ee831e66d59afbf02d42ba59b7ba21f61c011 (diff) | |
download | e-DoKo-293b20963f2bbf0cfca1a146506d65d615b01c2c.tar.gz e-DoKo-293b20963f2bbf0cfca1a146506d65d615b01c2c.tar.bz2 e-DoKo-293b20963f2bbf0cfca1a146506d65d615b01c2c.zip |
starting to bootstrap the layout: navbar and tricks
- changing the tricks-selector to a paginator and fixing the js for highlighting
- adding a navbar using bootstrap, probably should use .wrap more instead of adding divs to the code
Diffstat (limited to 'js')
-rw-r--r-- | js/game.js | 23 | ||||
-rw-r--r-- | js/layout.js | 3 |
2 files changed, 25 insertions, 1 deletions
@@ -5,9 +5,30 @@ var current=0; /* do the higlighting */ function hl(num) { var i; - for(i=0;i<14;i++){ $("#trick"+i).hide(); } + for(i=0;i<14;i++){ $("#trick"+i).hide(); $("#tricks"+i).removeClass('active'); } $("#trick"+num).css('display', 'block'); + $("#tricks"+num).addClass('active'); current=num; + + if(document.getElementById("tricks0")) + min=0; + else + min=1; + + if(document.getElementById("tricks13")) + max=13; + else + min=12; + + if(current==min) + $("#prevtr").addClass('disabled'); + else + $("#prevtr").removeClass('disabled'); + if(current==max) + $("#nexttr").addClass('disabled'); + else + $("#nexttr").removeClass('disabled'); + } /* highlight the last trick, useful when a page is called the first time*/ diff --git a/js/layout.js b/js/layout.js new file mode 100644 index 0000000..b98db8e --- /dev/null +++ b/js/layout.js @@ -0,0 +1,3 @@ +$(".navbar .nav").addClass("pull-right"); +$("table").addClass("table table-striped"); +$("ul.tricks").wrap('<div class="pagination">');
\ No newline at end of file |