fix merge conflict

This commit is contained in:
Jan-Christoph Borchardt 2011-07-28 03:22:55 +02:00
commit 09eff063de
1 changed files with 22 additions and 4 deletions

View File

@ -52,10 +52,27 @@ FileActions={
$('#file_menu').empty(); $('#file_menu').empty();
parent.append($('#file_menu')); parent.append($('#file_menu'));
var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType()); var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType());
var defaultAction=FileActions.getDefault(FileActions.getCurrentMimeType(),FileActions.getCurrentType());
for(name in actions){ for(name in actions){
var html='<a href="#" alt="'+name+'">'+name+'</a>'; if(actions[name]!=defaultAction && name!='Delete'){
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['Delete']){
var html='<a href="#" alt="Delete" id="action_delete">Delete</a>';
var element=$(html); var element=$(html);
element.data('action',name); element.data('action','Delete');
element.click(function(event){ element.click(function(event){
event.stopPropagation(); event.stopPropagation();
event.preventDefault(); event.preventDefault();
@ -64,7 +81,7 @@ FileActions={
FileActions.hide(); FileActions.hide();
action(currentFile); action(currentFile);
}); });
$('#file_menu').append(element); parent.parent().children().last().append(element);
} }
$('#file_menu').show(); $('#file_menu').show();
return false; return false;
@ -72,6 +89,7 @@ FileActions={
hide:function(){ hide:function(){
$('#file_menu').hide(); $('#file_menu').hide();
$('#file_menu').empty(); $('#file_menu').empty();
$('#action_delete').remove();
$('body').append($('#file_menu')); $('body').append($('#file_menu'));
}, },
getCurrentFile:function(){ getCurrentFile:function(){