]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix group delete/restore
authorBjoern Schiessle <schiessle@owncloud.com>
Wed, 9 Oct 2013 10:35:15 +0000 (12:35 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Wed, 9 Oct 2013 10:35:15 +0000 (12:35 +0200)
apps/files_trashbin/index.php
apps/files_trashbin/js/trash.js

index d8661e170a58cd69ebde886cb0fa92192969916f..d079af3fb6d185ddf58bf3dfa7a840cedac18995 100644 (file)
@@ -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']) : '';
 
index c530727e6234b0e8bb4a062fce5d1d40a4920b5b..3cbe79686d75bfd2c521183c5112b666e8a07ed9 100644 (file)
@@ -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) {