summaryrefslogtreecommitdiffstats
path: root/static/functions/questions.js
diff options
context:
space:
mode:
authorGit <git@what.cd>2013-10-14 08:00:53 +0000
committerGit <git@what.cd>2013-10-14 08:00:53 +0000
commit4a141a9ed99d57e562b05c47ad8608149acdabed (patch)
tree22e874f6fd88d1153c4e427c31089945f00182d8 /static/functions/questions.js
parent7100fdf7a7d856e0cf87d7969e525f5a86b9badc (diff)
downloadGazelle-4a141a9ed99d57e562b05c47ad8608149acdabed.zip
Gazelle-4a141a9ed99d57e562b05c47ad8608149acdabed.tar.gz
Gazelle-4a141a9ed99d57e562b05c47ad8608149acdabed.tar.bz2
Empty commit
Diffstat (limited to 'static/functions/questions.js')
-rw-r--r--static/functions/questions.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/static/functions/questions.js b/static/functions/questions.js
index 4348602..7729e52 100644
--- a/static/functions/questions.js
+++ b/static/functions/questions.js
@@ -1,4 +1,5 @@
$(document).ready(function() {
+ var open_responses =
$(".answer_link").click(function(e) {
e.preventDefault();
id = this.id;
@@ -18,7 +19,28 @@ $(document).ready(function() {
}).done(function() {
$("#question" + id).remove();
$("#answer" + id).remove();
+ $("#responses_for_" + id).remove();
});
});
+
+ $(".view_responses").click(function(e) {
+ e.preventDefault();
+ id = this.id;
+ if ($("#responses_for_" + id).length == 0) {
+ $.ajax({
+ type : "POST",
+ url : "questions.php?action=ajax_get_answers",
+ dataType : "html",
+ data : {
+ "id" : id,
+ "userid" : $(this).data("gazelle-userid")
+ }
+ }).done(function(response) {
+ $("#question" + id).after(response);
+ });
+ } else {
+ $("#responses_for_" + id).remove();
+ }
+ });
});