Skip to content

Commit

Permalink
Page changing
Browse files Browse the repository at this point in the history
  • Loading branch information
MasseR committed Apr 7, 2013
1 parent 698c19d commit b8c656b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions code/public/js/doThings.js
Expand Up @@ -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
Expand Down

0 comments on commit b8c656b

Please sign in to comment.