]> source.dussan.org Git - nextcloud-server.git/commitdiff
deleting stuff is scary, lets move the button as far to the right as possible
authorRobin Appelman <icewind1991@gmail.com>
Wed, 27 Jul 2011 21:31:38 +0000 (23:31 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Wed, 27 Jul 2011 21:32:37 +0000 (23:32 +0200)
it doesn't fit good currently in the column but will be fixed with using icons

files/css/files.css
files/js/fileactions.js

index 590c7bac364431f71f9554fd4f4ac3d5ed7cf489..37cb64bff0b34bd7ec9373f2af08dd098878808d 100644 (file)
@@ -88,7 +88,7 @@ table td.filesize, table td.date
 
 table td.date
 {
-    width: 11em;
+    width: 12em;
 }
 
 table td.selection, table th.selection, table td.fileaction
index a6891a5f82df4a514b0f110754978b2156d00cfb..4920e803b71e0a8bbd5f86461523979803901dd9 100644 (file)
@@ -54,7 +54,7 @@ FileActions={
                var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType());
                var defaultAction=FileActions.getDefault(FileActions.getCurrentMimeType(),FileActions.getCurrentType());
                for(name in actions){
-                       if(actions[name]!=defaultAction){
+                       if(actions[name]!=defaultAction && name!='Delete'){
                                var html='<a href="#" alt="'+name+'">'+name+'</a>';
                                var element=$(html);
                                element.data('action',name);
@@ -69,12 +69,27 @@ FileActions={
                                $('#file_menu').append(element);
                        }
                }
+               if(actions['Delete']){
+                       var html='<a href="#" alt="Delete" id="action_delete">Delete</a>';
+                       var element=$(html);
+                       element.data('action','Delete');
+                       element.click(function(event){
+                               event.stopPropagation();
+                               event.preventDefault();
+                               var action=actions[$(this).data('action')];
+                               var currentFile=FileActions.getCurrentFile();
+                               FileActions.hide();
+                               action(currentFile);
+                       });
+                       parent.parent().children().last().append(element);
+               }
                $('#file_menu').show();
                return false;
        },
        hide:function(){
                $('#file_menu').hide();
                $('#file_menu').empty();
+               $('#action_delete').remove();
                $('body').append($('#file_menu'));
        },
        getCurrentFile:function(){