From 5ab212f99c20ec6e9b00a329165051783b9fcbc5 Mon Sep 17 00:00:00 2001 From: holyantony Date: Thu, 14 May 2015 12:00:50 +0530 Subject: Subject: Auto select category name on Ask new question click Description: --- static/website/js/custom.js | 5 +++-- static/website/templates/index.html | 4 +++- static/website/templates/new-question.html | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/static/website/js/custom.js b/static/website/js/custom.js index 90ebe9c..5b584ee 100644 --- a/static/website/js/custom.js +++ b/static/website/js/custom.js @@ -1,5 +1,6 @@ $(document).ready(function() { - $category = $("#id_category"); + $("#id_category").val($category); + $tutorial = $("#id_tutorial"); $minute_range = $("#id_minute_range"); $second_range = $("#id_second_range"); @@ -55,7 +56,7 @@ $(document).ready(function() { $tutorial.change(function() { /* resetting dropdowns */ reset("minute_range", "second_range"); - var category = $category.val(); + var tutorial = $(this).val(); if(tutorial == "General") { /* disabling all other fields */ diff --git a/static/website/templates/index.html b/static/website/templates/index.html index fcdf8cb..f7c3f37 100644 --- a/static/website/templates/index.html +++ b/static/website/templates/index.html @@ -22,7 +22,9 @@ {{ category }} {% latest_question category %} - Ask new question + + + Ask new question diff --git a/static/website/templates/new-question.html b/static/website/templates/new-question.html index 85900f7..ed2c541 100644 --- a/static/website/templates/new-question.html +++ b/static/website/templates/new-question.html @@ -18,6 +18,7 @@