summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-10-09 12:35:15 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-10-09 12:35:15 +0200
commit31a91ef89294087335077b3ffea1b2a6d882c3ef (patch)
treec0d39f1f53042b0404bee388f88a058c97829430
parent9e3d28871e837d42fa495a9237bea24b0f0fd414 (diff)
downloadnextcloud-server-31a91ef89294087335077b3ffea1b2a6d882c3ef.tar.gz
nextcloud-server-31a91ef89294087335077b3ffea1b2a6d882c3ef.zip
fix group delete/restore
-rw-r--r--apps/files_trashbin/index.php2
-rw-r--r--apps/files_trashbin/js/trash.js35
2 files changed, 18 insertions, 19 deletions
diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php
index d8661e170a5..d079af3fb6d 100644
--- a/apps/files_trashbin/index.php
+++ b/apps/files_trashbin/index.php
@@ -5,7 +5,6 @@ OCP\User::checkLoggedIn();
OCP\App::setActiveNavigationEntry('files_index');
-OCP\Util::addScript('files_trashbin', 'trash');
OCP\Util::addScript('files_trashbin', 'disableDefaultActions');
OCP\Util::addScript('files', 'fileactions');
$tmpl = new OCP\Template('files_trashbin', 'index', 'user');
@@ -15,6 +14,7 @@ OCP\Util::addScript('files', 'filelist');
// filelist overrides
OCP\Util::addScript('files_trashbin', 'filelist');
OCP\Util::addscript('files', 'files');
+OCP\Util::addScript('files_trashbin', 'trash');
$dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : '';
diff --git a/apps/files_trashbin/js/trash.js b/apps/files_trashbin/js/trash.js
index c530727e623..3cbe79686d7 100644
--- a/apps/files_trashbin/js/trash.js
+++ b/apps/files_trashbin/js/trash.js
@@ -95,14 +95,13 @@ $(document).ready(function() {
$('.undelete').click('click',function(event) {
event.preventDefault();
- var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'perform restore operation')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>';
var files=getSelectedFiles('file');
var fileslist = JSON.stringify(files);
var dirlisting=getSelectedFiles('dirlisting')[0];
disableActions();
for (var i=0; i<files.length; i++) {
- var undeleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date");
- undeleteAction[0].innerHTML = undeleteAction[0].innerHTML+spinner;
+ var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date").children(".action.delete");
+ deleteAction.removeClass('delete-icon').addClass('progress-icon');
}
$.post(OC.filePath('files_trashbin','ajax','undelete.php'),
@@ -118,34 +117,34 @@ $(document).ready(function() {
enableActions();
}
);
-
});
$('.delete').click('click',function(event) {
event.preventDefault();
- var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'Delete permanently')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>';
var files=getSelectedFiles('file');
var fileslist = JSON.stringify(files);
var dirlisting=getSelectedFiles('dirlisting')[0];
disableActions();
for (var i=0; i<files.length; i++) {
- var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date");
- deleteAction[0].innerHTML = deleteAction[0].innerHTML+spinner;
+ var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date").children(".action.delete");
+ deleteAction.removeClass('delete-icon').addClass('progress-icon');
}
$.post(OC.filePath('files_trashbin','ajax','delete.php'),
- {files:fileslist, dirlisting:dirlisting},
- function(result){
- for (var i = 0; i < result.data.success.length; i++) {
- var row = document.getElementById(result.data.success[i].filename);
- row.parentNode.removeChild(row);
- }
- if (result.status !== 'success') {
- OC.dialogs.alert(result.data.message, t('core', 'Error'));
- }
- enableActions();
- });
+ {files:fileslist, dirlisting:dirlisting},
+ function(result){
+ for (var i = 0; i < result.data.success.length; i++) {
+ var row = document.getElementById(result.data.success[i].filename);
+ row.parentNode.removeChild(row);
+ }
+ if (result.status !== 'success') {
+ OC.dialogs.alert(result.data.message, t('core', 'Error'));
+ }
+ enableActions();
+ }
+ );
+
});
$('#fileList').on('click', 'td.filename a', function(event) {