From: Robin Appelman Date: Wed, 27 Jul 2011 21:31:38 +0000 (+0200) Subject: deleting stuff is scary, lets move the button as far to the right as possible X-Git-Tag: v3.0~267^2~364^2~21^2~22^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=90ecd2c293f96a2e5041767afaf4266af30c4601;p=nextcloud-server.git deleting stuff is scary, lets move the button as far to the right as possible it doesn't fit good currently in the column but will be fixed with using icons --- diff --git a/files/css/files.css b/files/css/files.css index 590c7bac364..37cb64bff0b 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -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 diff --git a/files/js/fileactions.js b/files/js/fileactions.js index a6891a5f82d..4920e803b71 100644 --- a/files/js/fileactions.js +++ b/files/js/fileactions.js @@ -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=''+name+''; var element=$(html); element.data('action',name); @@ -69,12 +69,27 @@ FileActions={ $('#file_menu').append(element); } } + if(actions['Delete']){ + var html='Delete'; + 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(){