diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2014-12-18 10:26:41 +0100 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2015-01-02 10:28:41 +0100 |
commit | 7e6c660b008d158de92a664b56359ed0750b82a8 (patch) | |
tree | e47dba072d47b84fc087c6d1aaec8f1664fc4c77 /search/js | |
parent | d063c8e0429b680c9998f91075b18297f55ae62d (diff) | |
download | nextcloud-server-7e6c660b008d158de92a664b56359ed0750b82a8.tar.gz nextcloud-server-7e6c660b008d158de92a664b56359ed0750b82a8.zip |
filter new rows
Diffstat (limited to 'search/js')
-rw-r--r-- | search/js/search.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/search/js/search.js b/search/js/search.js index 2da5dd5c3d2..28e6fa999a0 100644 --- a/search/js/search.js +++ b/search/js/search.js @@ -26,7 +26,7 @@ Search.prototype = { /** - * Initialize the search box and results + * Initialize the search box * * @param $searchBox container element with existing markup for the #searchbox form * @private @@ -182,6 +182,7 @@ $('#app-content').on('scroll', _.bind(onScroll, this)); lastResults = results; $status = $searchResults.find('#status') + .data('count', results.length) .text(t('search', '{count} search results in other folders', {count:results.length}, results.length)); placeStatus(); showResults(results); @@ -210,7 +211,7 @@ * Give plugins the ability to customize the search results. see result.js for examples */ if (that.hasRenderer(result.type)) { - that.getRenderer(result.type)($row, result); + $row = that.getRenderer(result.type)($row, result); } else { // for backward compatibility add text div $row.find('td.info div.name').addClass('result'); @@ -220,7 +221,14 @@ OC.search.customResults[result.type]($row, result); } } - $searchResults.find('tbody').append($row); + if ($row) { + $searchResults.find('tbody').append($row); + } else { + // not showing result, decrease counter + var count = $status.data('count') - 1; + $status.data('count', count) + .text(t('search', '{count} search results in other folders', {count:count}, count)); + } }); } function renderCurrent() { |