fix file action dialog not reappearing after being used

This commit is contained in:
Robin Appelman 2011-06-04 22:35:50 +02:00
parent dab656007d
commit 40a96aab28
1 changed files with 5 additions and 4 deletions

View File

@ -46,7 +46,7 @@ FileActions={
}
},
display:function(parent){
$('#file_menu>ul').empty();
$('#file_menu ul').empty();
parent.append($('#file_menu'));
var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType());
for(name in actions){
@ -55,7 +55,10 @@ FileActions={
element.data('action',name);
element.click(function(event){
event.preventDefault();
actions[$(this).data('action')](FileActions.getCurrentFile());
$('#file_menu').slideToggle(250);
var action=actions[$(this).data('action')];
$('#file_menu ul').empty();
action(FileActions.getCurrentFile());
});
$('#file_menu>ul').append(element);
}
@ -75,7 +78,6 @@ FileActions={
FileActions.register('all','Download',function(filename){
window.location='ajax/download.php?files='+filename+'&dir='+$('#dir').val();
$('#file_menu').slideToggle(250);
});
FileActions.register('all','Delete',function(filename){
@ -94,7 +96,6 @@ FileActions.setDefault('all','Download');
FileActions.register('dir','Open',function(filename){
window.location='index.php?dir='+$('#dir').val()+'/'+filename;
$('#file_menu').slideToggle(250);
});
FileActions.setDefault('dir','Open');