summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-07-30 00:34:36 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-07-30 00:34:36 +0200
commit7425efade78a04f20cb3cc83f964c6a00094b6ce (patch)
tree967aa50e8873c88f0adf6f91d0285ab1c54b7189 /apps/files/js
parentb4a523927823ab8bc80c5f1fc0d5bd5ef61f8eb8 (diff)
parent7c6246fa451c4646dfaa1396dd37e0b3eb9706ba (diff)
downloadnextcloud-server-7425efade78a04f20cb3cc83f964c6a00094b6ce.tar.gz
nextcloud-server-7425efade78a04f20cb3cc83f964c6a00094b6ce.zip
Merge branch 'master' into oc_preview
Conflicts: 3rdparty lib/template.php
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/filelist.js6
-rw-r--r--apps/files/js/files.js14
2 files changed, 14 insertions, 6 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 036d4bd6f07..288648693be 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -47,7 +47,7 @@ var FileList={
//size column
if(size!=t('files', 'Pending')){
- simpleSize=simpleFileSize(size);
+ simpleSize = humanFileSize(size);
}else{
simpleSize=t('files', 'Pending');
}
@@ -55,7 +55,6 @@ var FileList={
var lastModifiedTime = Math.round(lastModified.getTime() / 1000);
td = $('<td></td>').attr({
"class": "filesize",
- "title": humanFileSize(size),
"style": 'color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')'
}).text(simpleSize);
tr.append(td);
@@ -171,6 +170,8 @@ var FileList={
}
}else if(type=='dir' && $('tr[data-file]').length>0){
$('tr[data-file]').first().before(element);
+ } else if(type=='file' && $('tr[data-file]').length>0) {
+ $('tr[data-file]').last().before(element);
}else{
$('#fileList').append(element);
}
@@ -392,6 +393,7 @@ var FileList={
files.removeClass('selected');
});
procesSelection();
+ checkTrashStatus();
} else {
$.each(files,function(index,file) {
var deleteAction = $('tr').filterAttr('data-file',file).children("td.date").children(".move2trash");
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 6eb3a7b1e72..53c6de09dd0 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -121,7 +121,7 @@ $(document).ready(function() {
});
// Show trash bin
- $('#trash a').live('click', function() {
+ $('#trash').on('click', function() {
window.location=OC.filePath('files_trashbin', '', 'index.php');
});
@@ -759,9 +759,7 @@ function procesSelection(){
for(var i=0;i<selectedFolders.length;i++){
totalSize+=selectedFolders[i].size;
};
- simpleSize=simpleFileSize(totalSize);
- $('#headerSize').text(simpleSize);
- $('#headerSize').attr('title',humanFileSize(totalSize));
+ $('#headerSize').text(humanFileSize(totalSize));
var selection='';
if(selectedFolders.length>0){
if(selectedFolders.length==1){
@@ -854,3 +852,11 @@ function getUniqueName(name){
}
return name;
}
+
+function checkTrashStatus() {
+ $.post(OC.filePath('files_trashbin', 'ajax', 'isEmpty.php'), function(result){
+ if (result.data.isEmpty === false) {
+ $("input[type=button][id=trash]").removeAttr("disabled");
+ }
+ });
+}