Commit bcf574898c614f669db14a558609b35ffd9417ff
1 parent
8952483e
Exists in
master
and in
5 other branches
Fixing function
Showing
1 changed file
with
5 additions
and
5 deletions
Show diff stats
forum/static/js/forum.js
@@ -44,10 +44,10 @@ function createForum(url, topic) { | @@ -44,10 +44,10 @@ function createForum(url, topic) { | ||
44 | url: url, | 44 | url: url, |
45 | data: {'topic': topic}, | 45 | data: {'topic': topic}, |
46 | success: function(data) { | 46 | success: function(data) { |
47 | - $(".topic_" + topic).find(".forum_form").html(data); | 47 | + $(".forum_form").html(data); |
48 | $("#id_topic").val(topic); | 48 | $("#id_topic").val(topic); |
49 | 49 | ||
50 | - setForumCreateFormSubmit(); | 50 | + setForumCreateFormSubmit(topic); |
51 | } | 51 | } |
52 | }); | 52 | }); |
53 | 53 | ||
@@ -59,7 +59,7 @@ function createForum(url, topic) { | @@ -59,7 +59,7 @@ function createForum(url, topic) { | ||
59 | * Function to set the forum's create form submit function | 59 | * Function to set the forum's create form submit function |
60 | * | 60 | * |
61 | */ | 61 | */ |
62 | -function setForumCreateFormSubmit() { | 62 | +function setForumCreateFormSubmit(topic) { |
63 | $('.date-picker').datepicker({ | 63 | $('.date-picker').datepicker({ |
64 | language: locale, | 64 | language: locale, |
65 | }); | 65 | }); |
@@ -72,13 +72,13 @@ function setForumCreateFormSubmit() { | @@ -72,13 +72,13 @@ function setForumCreateFormSubmit() { | ||
72 | data: frm.serialize(), | 72 | data: frm.serialize(), |
73 | dataType: "json", | 73 | dataType: "json", |
74 | success: function (data) { | 74 | success: function (data) { |
75 | - $('.foruns_list').append("<li><i class='fa fa-commenting' aria-hidden='true'></i> <a id='forum_"+data.forum_id+"' href='"+data.url+"'> "+data.name+"</a></li>"); | 75 | + $(".topic_" + topic).find('.foruns_list').append("<li><i class='fa fa-commenting' aria-hidden='true'></i> <a id='forum_"+data.forum_id+"' href='"+data.url+"'> "+data.name+"</a></li>"); |
76 | 76 | ||
77 | $("#createForum").modal('hide'); | 77 | $("#createForum").modal('hide'); |
78 | }, | 78 | }, |
79 | error: function(data) { | 79 | error: function(data) { |
80 | $(".forum_form").html(data.responseText); | 80 | $(".forum_form").html(data.responseText); |
81 | - setForumCreateFormSubmit(); | 81 | + setForumCreateFormSubmit(topic); |
82 | } | 82 | } |
83 | }); | 83 | }); |
84 | return false; | 84 | return false; |