show no files found message
This commit is contained in:
parent
9e3f4e043f
commit
0cca9e26c4
|
@ -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;
|
||||
}
|
|
@ -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');
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue