Fix for issue 136
authorwilliam-bratches <williambratches@gmail.com>
Sat, 22 Mar 2014 00:40:31 +0000 (20:40 -0400)
committerwilliam-bratches <williambratches@gmail.com>
Sat, 22 Mar 2014 00:40:31 +0000 (20:40 -0400)
karmaworld/templates/courses/course_list.html

index 08b4297c064311a6efaa9c754f5dee4fbd990d67..a874f63fee3f7d6024d60483536a6f17e48eddb7 100644 (file)
@@ -43,21 +43,24 @@ $(document).ready(function() {
     "aoColumnDefs": [ 
       {
         // 4th element: thanks
-        "aTargets": [ 3 ],
+        "aTargets": [ 6 ],
         "bSortable": true,
-        "bVisible": true
+        "bVisible": true,
+        "aDataSort": [ 3 ]
       },
       {
         // 3rd element: notes
-        "aTargets": [ 2 ],
+        "aTargets": [ 5 ],
         "bSortable": true,
-        "bVisible": true
+        "bVisible": true,
+        "aDataSort": [ 2 ]
       },
       {
         // 2nd element: date
-        "aTargets": [ 1 ],
+        "aTargets": [ 4 ],
         "bSortable": true,
-        "bVisible": true
+        "bVisible": true,
+        "aDataSort": [ 1 ]
       },
       {
         // 1st element: "sort by" label
@@ -67,24 +70,24 @@ $(document).ready(function() {
       }
     ],
     // Initial sorting
-    'aaSorting': [[3,'desc']]
-  })
+    'aaSorting': [[6,'desc']]
+  });
   $('.dataTables_filter input').attr("placeholder", "search courses");
   // TODO: can't prepend html to .dataTables_filter input html for fontawesome search icon
 });
 
-//button
-$(function(){
-    $('#paginate_enabled_next').click(function() {
-    $("#data-table-sort-by").ScrollTo();;
+  //scrolling scripts - scrolls to top of page after scrolling between pages
+    $(function(){
+        $('#paginate_enabled_next').click(function() {
+        $("#data-table-sort-by").ScrollTo();;
     });
-});
-
-$(function(){
-    $('#paginate_enabled_previous').click(function() {
-    $("#data-table-sort-by").ScrollTo();;
+  
+    $(function(){
+       $('paginate_enabled_previous').click(function() {
+       $("#data-table-sort-by").ScrollTo();;
     });
-});
+
+
 </script>
 {% endblock %}
 
@@ -108,8 +111,11 @@ $(function(){
         <thead>
           <tr>
             <th id="data-table-sort-by"> Sort by: </th>
+            <th class="no-display" id="data-table-date-hidden"> Date </th>
+            <th class="no-display" id="data-table-note-count-hidden"> # Notes </th>
+            <th class="no-display" id="data-table-thanks-hidden"> Popularity </th>
             <th id="data-table-date"> Date </th>
-            <th id="data-table-note-count"> #Notes </th>
+            <th id="data-table-note-count"> # Notes </th>
             <th id="data-table-thanks"> Popularity </th>
             <th class="no-display" id="data-table-upload"> Upload </th>
             <th class="no-display" id="data-table-course-name"> Course Name </th>