diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-07-27 23:23:46 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-07-27 23:23:46 +0200 |
commit | 7d5bc7974d9f7e7e3e1380b56fc77fd0eb3b87e1 (patch) | |
tree | 9ffebcf1662d44fc0d27db1a4cb05b961dfa8120 /files | |
parent | 556bf2ef4ddf1aa47f1ebd90494f562076fdeac2 (diff) | |
download | nextcloud-server-7d5bc7974d9f7e7e3e1380b56fc77fd0eb3b87e1.tar.gz nextcloud-server-7d5bc7974d9f7e7e3e1380b56fc77fd0eb3b87e1.zip |
do not show default file action in the file action list on hover
Diffstat (limited to 'files')
-rw-r--r-- | files/js/fileactions.js | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/files/js/fileactions.js b/files/js/fileactions.js index 3ad417c91c4..a6891a5f82d 100644 --- a/files/js/fileactions.js +++ b/files/js/fileactions.js @@ -52,19 +52,22 @@ FileActions={ $('#file_menu').empty(); parent.append($('#file_menu')); var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType()); + var defaultAction=FileActions.getDefault(FileActions.getCurrentMimeType(),FileActions.getCurrentType()); for(name in actions){ - var html='<a href="#" alt="'+name+'">'+name+'</a>'; - var element=$(html); - element.data('action',name); - element.click(function(event){ - event.stopPropagation(); - event.preventDefault(); - var action=actions[$(this).data('action')]; - var currentFile=FileActions.getCurrentFile(); - FileActions.hide(); - action(currentFile); - }); - $('#file_menu').append(element); + if(actions[name]!=defaultAction){ + var html='<a href="#" alt="'+name+'">'+name+'</a>'; + var element=$(html); + element.data('action',name); + element.click(function(event){ + event.stopPropagation(); + event.preventDefault(); + var action=actions[$(this).data('action')]; + var currentFile=FileActions.getCurrentFile(); + FileActions.hide(); + action(currentFile); + }); + $('#file_menu').append(element); + } } $('#file_menu').show(); return false; |