54 lines
1.3 KiB
JavaScript
54 lines
1.3 KiB
JavaScript
var faq_section_index = 0;
|
|
var faq_item_index = 0;
|
|
|
|
$(function()
|
|
{
|
|
$(".faq_item_title").on("click", function()
|
|
{
|
|
let id = $(this).data('id');
|
|
faq_item_index = id;
|
|
});
|
|
|
|
$("#faq_search_form_field").on("keydown", function(event)
|
|
{
|
|
if(event.keyCode === 13)
|
|
{
|
|
event.preventDefault();
|
|
$("#faq_search_form").submit();
|
|
}
|
|
});
|
|
|
|
$("#faq_search_form_field").on("input", function()
|
|
{
|
|
if($("#faq_search_form_field").val() !== "")
|
|
{
|
|
$("#faq_search_form_clear_button").css("display", "block");
|
|
//$("#faq_search_form_search_button").attr("disabled", false);
|
|
}
|
|
else
|
|
{
|
|
$("#faq_search_form_clear_button").css("display", "none");
|
|
//$("#faq_search_form_search_button").attr("disabled", "disabled");
|
|
}
|
|
});
|
|
|
|
$("#faq_search_form_clear_button").on("click", function(event)
|
|
{
|
|
event.preventDefault();
|
|
$("#faq_search_form_field").val("");
|
|
$("#faq_search_form_clear_button").css("display", "none");
|
|
//$("#faq_search_form_search_button").attr("disabled", "disabled");
|
|
});
|
|
|
|
$(".faq_section_button").on("click", function()
|
|
{
|
|
|
|
let section = $(this).data('section');
|
|
faq_section_index = section;
|
|
|
|
$(".faq_section_button").removeClass("active");
|
|
$(".faq_section_button_"+section).addClass("active");
|
|
$(".faq_items_list").css("display", "none");
|
|
$(".faq_items_list_"+section).css("display", "block");
|
|
});
|
|
}); |