From b1812bc15df17ca907b8eba5608c25e425940189 Mon Sep 17 00:00:00 2001 From: BeSthetic <33312714+BeSthetic@users.noreply.github.com> Date: Tue, 26 Mar 2019 12:21:41 +0100 Subject: [PATCH] Create js-search.js Script link for "Read more" in search results --- view/frontend/web/js/js-search.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 view/frontend/web/js/js-search.js diff --git a/view/frontend/web/js/js-search.js b/view/frontend/web/js/js-search.js new file mode 100644 index 0000000..88a2574 --- /dev/null +++ b/view/frontend/web/js/js-search.js @@ -0,0 +1,28 @@ +/* +* @Author: Abraham Osorio +* @Date: 2019-03-26 10:54:18 +* @Last Modified by: Abraham Osorio +* @Last Modified time: 2019-03-26 10:54:18 +*/ + +require([ + 'jquery' +], function ($) { + "use strict"; + + $(document).ready(function () { + $('.faq-content').find('ol').find('li').first().addClass('active'); + $('.faqs-list .item > a').on('click', function () { + if ($(this).parent().children('.description').css('display') !== 'none') { + $(this).parents('li').removeClass('active'); + } else { + $(this).parents('.faq-content').find('ol li').removeClass('active'); + $(this).parents('li').addClass('active'); + } + return false; + }); + $('.faq-content').find('ol li .read-more').click(function() { + window.location.href = $(this).parent().find('a').attr('href'); + }); + }); +});