From 797ac73ff93f2c5795289deb0ac983b8aedd9b49 Mon Sep 17 00:00:00 2001 From: matcornic Date: Sun, 23 Apr 2017 12:35:11 +0200 Subject: [PATCH] fixes #40 --- layouts/partials/search.html | 2 +- static/js/learn.js | 15 +-------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/layouts/partials/search.html b/layouts/partials/search.html index 9960df53f1..c902dcc5ee 100644 --- a/layouts/partials/search.html +++ b/layouts/partials/search.html @@ -1,6 +1,6 @@ diff --git a/static/js/learn.js b/static/js/learn.js index e17e289276..b776ac7ba5 100644 --- a/static/js/learn.js +++ b/static/js/learn.js @@ -139,20 +139,7 @@ jQuery(document).ready(function() { $(".highlightable").unhighlight({ element: 'mark' }).highlight(value, { element: 'mark' }); if (ajax && ajax.abort) ajax.abort(); - ajax = jQuery.ajax({ - url: input.data('search-input') + ':' + value - }).done(function(data) { - if (data && data.results && data.results.length) { - items.css('display', 'none'); - $('ul.topics').addClass('searched'); - data.results.forEach(function(navitem) { - jQuery('[data-nav-id="' + navitem + '"]').css('display', 'block').addClass('search-match'); - jQuery('[data-nav-id="' + navitem + '"]').parents('li').css('display', 'block'); - }); - } - ; - - }); + jQuery('[data-search-clear]').on('click', function() { jQuery('[data-search-input]').val('').trigger('input'); sessionStorage.removeItem('search-input');