]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixed delete action to show error message as notification
authorVincent Petry <pvince81@owncloud.com>
Thu, 14 Nov 2013 15:48:04 +0000 (16:48 +0100)
committerVincent Petry <pvince81@owncloud.com>
Tue, 19 Nov 2013 14:05:11 +0000 (15:05 +0100)
apps/files/js/filelist.js

index f20d942927135a3f023545e2ffcb43ad28930bbb..5cab0707bdab40d639d0136c89086f03ef62fc53 100644 (file)
@@ -569,8 +569,18 @@ var FileList={
                                                FileList.updateEmptyContent();
                                                Files.updateStorageStatistics();
                                        } else {
+                                               if (result.status === 'error' && result.data.message) {
+                                                       OC.Notification.show(result.data.message);
+                                               }
+                                               else {
+                                                       OC.Notification.show(t('files', 'Error deleting file.'));
+                                               }
+                                               // hide notification after 10 sec
+                                               setTimeout(function() {
+                                                       OC.Notification.hide();
+                                               }, 10000);
                                                $.each(files,function(index,file) {
-                                                       var deleteAction = $('tr[data-file="'+files[i]+'"]').children("td.date").children(".action.delete");
+                                                       var deleteAction = $('tr[data-file="' + file + '"] .action.delete');
                                                        deleteAction.removeClass('progress-icon').addClass('delete-icon');
                                                });
                                        }