From 7a812801db6cc2cddf4e176dc893b07c7c486d76 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 5 Jan 2015 17:53:14 +0100 Subject: [PATCH] correctly clear searchbox when switching filelists --- apps/files/js/filelist.js | 3 +++ search/js/search.js | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 768fc77df24..3e61e50f75d 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1713,6 +1713,9 @@ if (OCA.Search.files) { OCA.Search.files.setFileList(this); } + if (OC.Search) { + OC.Search.clear(); + } }, /** * Update UI based on the current selection diff --git a/search/js/search.js b/search/js/search.js index 58778900a69..c595ae25092 100644 --- a/search/js/search.js +++ b/search/js/search.js @@ -229,6 +229,14 @@ $searchResults.find('tr.result').remove(); lastQuery = false; }; + this.clear = function() { + self.hideResults(); + if(self.hasFilter(getCurrentApp())) { + self.getFilter(getCurrentApp())(''); + } + $searchBox.val(''); + $searchBox.blur(); + }; /** * Event handler for when scrolling the list container. -- 2.39.5