summaryrefslogtreecommitdiff
path: root/static/website/js/custom.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/website/js/custom.js')
-rw-r--r--static/website/js/custom.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/static/website/js/custom.js b/static/website/js/custom.js
index ef0752e..da5839b 100644
--- a/static/website/js/custom.js
+++ b/static/website/js/custom.js
@@ -5,6 +5,7 @@ $(document).ready(function() {
$second_range = $("#id_second_range");
$category.change(function() {
+ $("#similar-link").hide();
var category = $(this).val();
$.ajax({
url: "/ajax-tutorials/",
@@ -41,6 +42,27 @@ $(document).ready(function() {
}
});
});
+
+ $second_range.change(function() {
+ $.ajax({
+ url: "/ajax-similar-questions/",
+ type: "POST",
+ data: {
+ category: $category.val(),
+ tutorial: $tutorial.val(),
+ minute_range: $minute_range.val(),
+ second_range: $second_range.val()
+ },
+ dataType: "html",
+ success: function(data) {
+ console.log(data);
+ $response = $(data);
+ var similar_count= $response.find("#similar-count").text();
+ $("#similar-link").show().html(similar_count);
+ $(".modal-body").html(data);
+ }
+ });
+ });
$(document).ajaxStart(function() {
$("#ajax-loader").show();