summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-07-26 11:13:43 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-07-26 11:14:29 +0200
commita00cff7c0543a8860b839a0bf345478e99bc6c18 (patch)
treea4d256f02dca12026d021db1b46363157c5689da /apps/files/js
parent96e175ffbf6f209274395309e5b55ed724c5c2da (diff)
downloadnextcloud-server-a00cff7c0543a8860b839a0bf345478e99bc6c18.tar.gz
nextcloud-server-a00cff7c0543a8860b839a0bf345478e99bc6c18.zip
disable "deleted files" button if trash bin is empty
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/filelist.js1
-rw-r--r--apps/files/js/files.js12
2 files changed, 11 insertions, 2 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 04a9fb91649..b858e2580ee 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -392,6 +392,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 98fc53b71a9..55280edde42 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -121,10 +121,10 @@ $(document).ready(function() {
});
// Show trash bin
- $('#trash a').live('click', function() {
+ $('#trash').on('click', function() {
window.location=OC.filePath('files_trashbin', '', 'index.php');
});
-
+
var lastChecked;
// Sets the file link behaviour :
@@ -845,3 +845,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");
+ }
+ });
+} \ No newline at end of file