summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authoryour_name2015-09-21 16:20:57 +0530
committeryour_name2015-09-21 16:20:57 +0530
commit102d861dec83108aff90afeefbccbe5f80d8c16b (patch)
treeed18526b0ff6af68af5c7670f13e49ed5fa119e4 /static
parent30d80e37ee5604196f465c2b2c73b1d1a4f11f79 (diff)
downloadspoken-tutorial-forums-102d861dec83108aff90afeefbccbe5f80d8c16b.tar.gz
spoken-tutorial-forums-102d861dec83108aff90afeefbccbe5f80d8c16b.tar.bz2
spoken-tutorial-forums-102d861dec83108aff90afeefbccbe5f80d8c16b.zip
Subject:video tile, minute-range and second-range auto selected.
Description: 1) click on link post questions on forum from spoken-website. 2) current time of video will get fetch and set as minute and sec
Diffstat (limited to 'static')
-rw-r--r--static/website/js/custom.js20
1 files changed, 16 insertions, 4 deletions
diff --git a/static/website/js/custom.js b/static/website/js/custom.js
index 5565683..d60e1d5 100644
--- a/static/website/js/custom.js
+++ b/static/website/js/custom.js
@@ -3,7 +3,16 @@ $(document).ready(function() {
$tutorial = $("#id_tutorial");
$minute_range = $("#id_minute_range");
$second_range = $("#id_second_range");
-
+ var tutorial = $tutorial.val();
+ var category = $category.val();
+
+ if (tutorial == "Select a Tutorial" || tutorial =="General"){
+ $minute_range.attr("disabled", true);
+ $second_range.attr("disabled", true);
+ }else{
+ $minute_range.removeAttr("disabled");
+ $second_range.removeAttr("disabled");
+ }
function reset() {
for (var i = 0, l = arguments.length; i < l; i ++) {
switch(arguments[i]) {
@@ -41,7 +50,7 @@ $(document).ready(function() {
$minute_range.removeAttr("disabled");
$second_range.html("<option value='None'>Not required</option>");
$second_range.removeAttr("disabled");
- } else {
+ }else {
$.ajax({
url: "/ajax-tutorials/",
type: "POST",
@@ -67,12 +76,15 @@ $(document).ready(function() {
$minute_range.removeAttr("disabled");
$second_range.html("<option value='None'>Not required</option>");
$second_range.removeAttr("disabled");
- } else {
+ } else if (tutorial == "Select a Tutorial"){
+ $minute_range.attr("disabled");
+ $second_range.attr("disabled");
+ }else {
$.ajax({
url: "/ajax-duration/",
type: "POST",
data: {
- category: category,
+ category: category,
tutorial: tutorial
},
success: function(data){