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 | 44 | url: url, |
45 | 45 | data: {'topic': topic}, |
46 | 46 | success: function(data) { |
47 | - $(".topic_" + topic).find(".forum_form").html(data); | |
47 | + $(".forum_form").html(data); | |
48 | 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 | 59 | * Function to set the forum's create form submit function |
60 | 60 | * |
61 | 61 | */ |
62 | -function setForumCreateFormSubmit() { | |
62 | +function setForumCreateFormSubmit(topic) { | |
63 | 63 | $('.date-picker').datepicker({ |
64 | 64 | language: locale, |
65 | 65 | }); |
... | ... | @@ -72,13 +72,13 @@ function setForumCreateFormSubmit() { |
72 | 72 | data: frm.serialize(), |
73 | 73 | dataType: "json", |
74 | 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 | 77 | $("#createForum").modal('hide'); |
78 | 78 | }, |
79 | 79 | error: function(data) { |
80 | 80 | $(".forum_form").html(data.responseText); |
81 | - setForumCreateFormSubmit(); | |
81 | + setForumCreateFormSubmit(topic); | |
82 | 82 | } |
83 | 83 | }); |
84 | 84 | return false; | ... | ... |