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 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 7 alertify.confirm(confirm_message, function(){
8 8 $.ajax({
9 9 dataType: "json",
... ... @@ -12,6 +12,7 @@ function subscribe(elem, url, confirm_message) {
12 12 if (data.status == "ok") {
13 13 elem.remove();
14 14 alertify.success(data.message);
  15 + $(".panel_"+id).find(".view_btn").show()
15 16 } else {
16 17 alertify.error(data.message);
17 18 }
... ...