summaryrefslogtreecommitdiffstats
path: root/files
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-07-30 14:42:58 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-07-30 14:44:22 +0200
commit78d41a03e074c708d5f6082fd299bdbb3d545f73 (patch)
tree1e654bcb63184f7c937699024d64c79b31dc88b0 /files
parent95ec75b919f58fb55e561789d8a54d59312c7e19 (diff)
downloadnextcloud-server-78d41a03e074c708d5f6082fd299bdbb3d545f73.tar.gz
nextcloud-server-78d41a03e074c708d5f6082fd299bdbb3d545f73.zip
automatically hide show/hide the empty folder message
Diffstat (limited to 'files')
-rw-r--r--files/css/files.css1
-rw-r--r--files/js/filelist.js6
-rw-r--r--files/js/files.js4
-rw-r--r--files/templates/part.list.php4
4 files changed, 13 insertions, 2 deletions
diff --git a/files/css/files.css b/files/css/files.css
index 578d5df174b..c81960f5e48 100644
--- a/files/css/files.css
+++ b/files/css/files.css
@@ -6,6 +6,7 @@
#fileSelector, #file_upload_submit, #file_newfolder_submit { display:none; }
.file_upload_filename, #file_newfolder_name { background-repeat:no-repeat; background-position:0.5em 0; padding-left:2em; }
.file_upload_filename { background-image:url("../img/file.png"); font-weight:bold; }.file_upload_start { opacity:0;filter:alpha(opacity = 0); }
+input.highlight{ background-color:#ffc100; border:#dda600 1px solid; }
#file_newfolder_name { background-image:url("../img/folder.png"); font-weight:bold; width:11em; }
.file_upload_start, .file_upload_filename { position:absolute; top:0px; left:0px; width:11em; font-size:0.9em; }
diff --git a/files/js/filelist.js b/files/js/filelist.js
index c3a2522fb6a..862fb1797a6 100644
--- a/files/js/filelist.js
+++ b/files/js/filelist.js
@@ -66,6 +66,10 @@ FileList={
remove:function(name){
$('tr[data-file="'+name+'"] td.filename').draggable('destroy');
$('tr[data-file="'+name+'"]').remove();
+ if($('tr[data-file]').length==0){
+ $('#emptyfolder').show();
+ $('.file_upload_filename').addClass('highlight');
+ }
},
insertElement:function(name,type,element){
//find the correct spot to insert the file or folder
@@ -93,6 +97,8 @@ FileList={
}else{
$('#fileList').append(element);
}
+ $('#emptyfolder').hide();
+ $('.file_upload_filename').removeClass('highlight');
},
loadingDone:function(name){
$('tr[data-file="'+name+'"]').data('loading',false);
diff --git a/files/js/files.js b/files/js/files.js
index d3f91fe9a2f..7005502d942 100644
--- a/files/js/files.js
+++ b/files/js/files.js
@@ -1,4 +1,8 @@
$(document).ready(function() {
+ if($('tr[data-file]').length==0){
+ $('.file_upload_filename').addClass('highlight');
+ }
+
$('#file_action_panel').attr('activeAction', false);
//drag/drop of files
diff --git a/files/templates/part.list.php b/files/templates/part.list.php
index 40586664328..8f55440fe48 100644
--- a/files/templates/part.list.php
+++ b/files/templates/part.list.php
@@ -1,5 +1,5 @@
- <?php if(!$_['files']) echo '<span id="emptyfolder">Nothing in here. Upload something!<style>.file_upload_filename { background-color:#ffc100; border:#dda600 1px solid; }</style></span>';
- foreach($_['files'] as $file):
+ <span id="emptyfolder" <?php if(count($_['files'])) echo 'style="display:none;"';?>>Nothing in here. Upload something!</span>
+ <?php foreach($_['files'] as $file):
$simple_file_size = simple_file_size($file['size']);
$simple_size_color = 200-intval($file['size']/(1024*1024)*2); // the bigger the file, the darker the shade of grey
if($simple_size_color<0) $simple_size_color = 0;