show no files found message

This commit is contained in:
Jörn Friedrich Dreyer 2015-01-02 12:50:21 +01:00
parent 9e3f4e043f
commit 0cca9e26c4
5 changed files with 51 additions and 18 deletions

View File

@ -599,3 +599,26 @@ table.dragshadow td.size {
.mask.transparent{
opacity: 0;
}
#nofilterresults {
font-size: 16px;
color: #888;
position: absolute;
text-align: center;
top: 30%;
width: 100%;
}
#nofilterresults h2 {
font-size: 22px;
margin-bottom: 10px;
}
#nofilterresults [class^="icon-"],
#nofilterresults [class*=" icon-"] {
background-size: 64px;
height: 64px;
width: 64px;
margin: 0 auto 15px;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
filter: alpha(opacity=50);
opacity: .5;
}

View File

@ -1685,9 +1685,14 @@
if (this._filter && this.fileSummary.summary.totalDirs + this.fileSummary.summary.totalFiles === 0) {
this.$el.find('#filestable thead th').addClass('hidden');
this.$el.find('#emptycontent').addClass('hidden');
if ( $('#searchresults').length === 0 || $('#searchresults').hasClass('hidden')) {
this.$el.find('#nofilterresults').removeClass('hidden').
find('p').text(t('files', 'No entries in this folder match \'{filter}\'', {filter:this._filter}));
}
} else {
this.$el.find('#filestable thead th').toggleClass('hidden', this.isEmpty);
this.$el.find('#emptycontent').toggleClass('hidden', !this.isEmpty);
this.$el.find('#nofilterresults').addClass('hidden');
}
},
/**

View File

@ -40,11 +40,18 @@
result.mime = result.mime_type;
}
}
function hideNoFilterResults (){
var $nofilterresults = $('#nofilterresults');
if ( ! $nofilterresults.hasClass('hidden') ) {
$nofilterresults.addClass('hidden');
}
}
this.renderFolderResult = function($row, result) {
if (inFileList($row, result)) {
return null;
}
hideNoFilterResults();
/*render folder icon, show path beneath filename,
show size and last modified date on the right */
this.updateLegacyMimetype(result);
@ -61,6 +68,7 @@
if (inFileList($row, result)) {
return null;
}
hideNoFilterResults();
/*render preview icon, show path beneath filename,
show size and last modified date on the right */
this.updateLegacyMimetype(result);

View File

@ -60,6 +60,12 @@
<p><?php p($l->t('Upload some content or sync with your devices!')); ?></p>
</div>
<div id="nofilterresults" class="hidden">
<div class="icon-folder"></div>
<h2><?php p($l->t('No files found in this folder')); ?></h2>
<p></p>
</div>
<table id="filestable" data-allow-public-upload="<?php p($_['publicUploadEnabled'])?>" data-preview-x="36" data-preview-y="36">
<thead>
<tr>

View File

@ -109,7 +109,7 @@
}
}
// prevent double pages
if ($searchResults && query === lastQuery && page === lastPage&& size === lastSize) {
if ($searchResults && query === lastQuery && page === lastPage && size === lastSize) {
return;
}
lastQuery = query;
@ -153,9 +153,6 @@
}
}
function showResults(results) {
if (results.length === 0) {
return;
}
if (!$searchResults) {
$wrapper = $('<div class="searchresults-wrapper"/>');
$('#app-content')
@ -190,9 +187,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));
$status = $searchResults.find('#status');
placeStatus();
showResults(results);
});
@ -231,16 +226,11 @@
}
if ($row) {
$searchResults.find('tbody').append($row);
} else {
// not showing result, decrease counter
var count = $status.data('count') - 1;
if (count < 0) {
count = 0;
}
$status.data('count', count)
.text(t('search', '{count} search results in other places', {count:count}, count));
}
});
var count = $searchResults.find('tr.result').length;
$status.data('count', count)
.text(t('search', '{count} search results in other places', {count:count}, count));
}
function renderCurrent() {
var result = $searchResults.find('tr.result')[currentResult];
@ -263,6 +253,7 @@
$wrapper.remove();
$searchResults = false;
$wrapper = false;
lastQuery = false;
}
};
@ -292,14 +283,14 @@
var query = $searchBox.val();
if (lastQuery !== query) {
currentResult = -1;
if(self.hasFilter(getCurrentApp())) {
self.getFilter(getCurrentApp())(query);
}
if (query.length > 2) {
self.search(query);
} else {
self.hideResults();
}
if(self.hasFilter(getCurrentApp())) {
self.getFilter(getCurrentApp())(query);
}
}
}
});