From d064e304ee825396ea12d16c131a9aeae7713bc7 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 13 Nov 2017 13:37:50 +0100 Subject: [PATCH] When no history.search.value -> display all --- public_html/view/js/history.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/public_html/view/js/history.js b/public_html/view/js/history.js index 5d661ce..80ec14e 100644 --- a/public_html/view/js/history.js +++ b/public_html/view/js/history.js @@ -43,6 +43,22 @@ if( section.view.element != null ){ /* (2) Gestion de la recherche instantannee */ section.view.search.func = function(){ + + // if no keyword -> show all + if( section.view.search.bar.value.length == 0 ){ + + // On recupere la liste des elements correspondants aux utilisateurs + var history_list = document.querySelectorAll(section.view.text + '> article.inline-row[id]'); + + // Affiche chaque carte + for( var i = 0 ; i < history_list.length ; i++ ) + history_list[i].remClass('hidden'); + + return; + + } + + var search = { path: 'historyDefault/search', keywords: section.view.search.bar.value