Commit b88e6fc3195ee9f18386d04cd2cba301bf6fc633

Authored by Zambom
1 parent 387bce91

Refactoring script to show view button if subscribed [Issues: #192 & #195]

Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
courses/static/js/course.js
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 * Function to subscribe (works for courses and subjects) 3 * Function to subscribe (works for courses and subjects)
4 * 4 *
5 */ 5 */
6 -function subscribe(elem, url, confirm_message) { 6 +function subscribe(elem, url, id, confirm_message) {
7 alertify.confirm(confirm_message, function(){ 7 alertify.confirm(confirm_message, function(){
8 $.ajax({ 8 $.ajax({
9 dataType: "json", 9 dataType: "json",
@@ -12,6 +12,7 @@ function subscribe(elem, url, confirm_message) { @@ -12,6 +12,7 @@ function subscribe(elem, url, confirm_message) {
12 if (data.status == "ok") { 12 if (data.status == "ok") {
13 elem.remove(); 13 elem.remove();
14 alertify.success(data.message); 14 alertify.success(data.message);
  15 + $(".panel_"+id).find(".view_btn").show()
15 } else { 16 } else {
16 alertify.error(data.message); 17 alertify.error(data.message);
17 } 18 }