Fix navigation icon
authorchapel <jacob.chapel@gmail.com>
Sun, 20 Nov 2011 04:30:44 +0000 (20:30 -0800)
committerchapel <jacob.chapel@gmail.com>
Sun, 20 Nov 2011 04:30:44 +0000 (20:30 -0800)
public/index.html
public/javascripts/main.js

index 08ea68ee25fe8ff8a1e573128102c6a5c48b1d91..fce9b25e4caec6d83e7eba596f3410a4a63163ae 100755 (executable)
                                                </nav>
                                                <nav id="main-nav" class="small">
                                                        <ul>
-                                                               <li id=course_link><a href="/schools" class="active"><em class="icon"></em>Courses</a></li>
+                                                               <li><a href="/schools" id=school_link class="nav"><em class="icon"></em>Courses</a></li>
                                                                <li><a href="http://blog.finalsclub.org"><em class="icon"></em>Blog</a></li>
-                                                               <li id=archive_link><a href="/archive"><em class="icon"></em>Library</a></li>
-                                                               <li id=press_link><a href="/press"><em class="icon"></em>Press</a></li>
-                                                               <li id=register_link><a href="/register"><em class="icon"></em>Register</a></li>
-                                                               <li id=profile_link><a href="/profile"><em class="icon"></em>Profile</a></li>
+                                                               <li><a href="/archive" id=archive_link class="nav"><em class="icon"></em>Library</a></li>
+                                                               <li><a href="/press" id=press_link class="nav"><em class="icon"></em>Press</a></li>
+                                                               <li><a href="/register" id=register_link class="nav"><em class="icon"></em>Register</a></li>
+                                                               <li><a href="/profile" id=profile_link class="nav"><em class="icon"></em>Profile</a></li>
                                                                <!-- li><a href="#" class="donate"><em class="icon"></em><em class="lc yellow">Donate</em></a></li -->
                                                        </ul>
                                                </nav>
index b336571658399e622fbcc3d29acbed7b078e2cf5..a85d6878ee6b4a7ebab4fb979cea954461c23b6b 100644 (file)
@@ -29,6 +29,7 @@ var router = {
     }
   },
   run: function(name, path) {
+    $('.nav').removeClass('active');
     checkUser(function() {
       if (router.routes[name].useAjax) {
         $.get(path, {cache: false}, function(data) {
@@ -99,6 +100,7 @@ router.add('404', false, function() {
 
 router.add('home', false, function(cb) {
   $('#learnsomething').unbind();
+  $('.nav').removeClass('active');
        cb("home");
   $('#learnsomething').click(function(e) {
     $.get('/learn/random', function(data) {
@@ -116,7 +118,7 @@ router.add('home', false, function(cb) {
 
 // go to the page that lists the schools
 router.add('schools', function(data, cb) {
-
+  $('#school_link').addClass('active');
   var response = {
     id: 'school',
     data: data.schools
@@ -129,6 +131,7 @@ router.add('schools', function(data, cb) {
 
 // go to the page that lists the courses for a specific school
 router.add('school', function(data, cb) {
+  $('#school_link').addClass('active');
   $('.sub_menu').hide();
   $('#new_course').unbind();
   $('#form_course').hide().unbind();
@@ -171,6 +174,7 @@ router.add('school', function(data, cb) {
 
 // go to the page that lists the lectures for a specific course
 router.add('course', function(data, cb) {
+  $('#school_link').addClass('active');
   $('.sub_menu').hide();
   $('#new_lecture').unbind();
   $('#form_lecture').hide().unbind();;
@@ -240,6 +244,7 @@ router.add('course', function(data, cb) {
 
 // go to the page that lists the note taking sessions for a specific lecture
 router.add('lecture', function(data, cb) {
+  $('#school_link').addClass('active');
   $('.sub_menu').hide();
   $('#new_note').unbind();
   $('#form_note').hide().unbind();;
@@ -304,6 +309,7 @@ router.add('lecture', function(data, cb) {
 
 // go to the page that lists the archived subject names
 router.add('archive', function(data, cb) {
+  $('#archive_link').addClass('active');
 
   var response = {
     id: 'archive_subject',
@@ -316,6 +322,8 @@ router.add('archive', function(data, cb) {
 
 
 router.add('archivesubject', function(data, cb) {
+  $('.nav').removeClass('active');
+  $('#archive_link').addClass('active');
 
   var response = {
     id: 'archive_course',
@@ -328,6 +336,7 @@ router.add('archivesubject', function(data, cb) {
 
 
 router.add('archivecourse', function(data, cb) {
+  $('#archive_link').addClass('active');
 
   var response = {
     id: 'archive_note',
@@ -340,6 +349,7 @@ router.add('archivecourse', function(data, cb) {
 
 
 router.add('archivenote', function(data, cb) {
+  $('#archive_link').addClass('active');
 
   var response = {
     id: 'archive_note_display',
@@ -353,6 +363,7 @@ router.add('archivenote', function(data, cb) {
 
 // go to the account registration page
 router.add('register', false, function(cb) {
+  $('#register_link').addClass('active');
   $('#form_register').submit(function(e) {
     e.preventDefault();
 
@@ -377,6 +388,7 @@ router.add('activate', function(data, cb) {
 });
 
 router.add('profile', false, function(cb) {
+  $('#profile_link').addClass('active');
   var form = $('#form_profile');
   $('input[type=password]','#form_profile').val('');
   $('#affiliation').attr('value', user.affil);
@@ -466,6 +478,7 @@ router.add('resetpw', false, function(cb) {
 
 // go to the press articles page
 router.add('press', false, function(cb) {
+  $('#press_link').addClass('active');
        cb("press");
 });