Permalink
Browse files

Page changing

  • Loading branch information...
1 parent 698c19d commit b8c656bea07821eb81925c71590863ade5a329b5 @MasseR committed Apr 7, 2013
Showing with 15 additions and 0 deletions.
  1. +15 −0 code/public/js/doThings.js
View
@@ -3,6 +3,21 @@ $(document).ready(function() {
var currentPage = $(".sidebar-nav a[href='#']").asEventStream('click').map(function(ev) {
return $(ev.currentTarget).attr('data-target');
}).toProperty('students').skipDuplicates();
+ currentPage.onValue(function(page) {
+ // Sorry, not the most elegant solution. good enough when there are 3 pages
+ if(page == 'students')
+ $("#userData").show();
+ else
+ $("#userData").hide();
+ if(page == 'degrees')
+ $("#degreeData").show();
+ else
+ $("#degreeData").hide();
+ if(page == 'credits')
+ $("#creditData").show();
+ else
+ $("#creditData").hide();
+ });
var initPage = function(settings) {
var modalTemplate = settings.template

0 comments on commit b8c656b

Please sign in to comment.