fix file action dialog not reappearing after being used
This commit is contained in:
parent
dab656007d
commit
40a96aab28
|
@ -46,7 +46,7 @@ FileActions={
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
display:function(parent){
|
display:function(parent){
|
||||||
$('#file_menu>ul').empty();
|
$('#file_menu ul').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());
|
||||||
for(name in actions){
|
for(name in actions){
|
||||||
|
@ -55,7 +55,10 @@ FileActions={
|
||||||
element.data('action',name);
|
element.data('action',name);
|
||||||
element.click(function(event){
|
element.click(function(event){
|
||||||
event.preventDefault();
|
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);
|
$('#file_menu>ul').append(element);
|
||||||
}
|
}
|
||||||
|
@ -75,7 +78,6 @@ FileActions={
|
||||||
|
|
||||||
FileActions.register('all','Download',function(filename){
|
FileActions.register('all','Download',function(filename){
|
||||||
window.location='ajax/download.php?files='+filename+'&dir='+$('#dir').val();
|
window.location='ajax/download.php?files='+filename+'&dir='+$('#dir').val();
|
||||||
$('#file_menu').slideToggle(250);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
FileActions.register('all','Delete',function(filename){
|
FileActions.register('all','Delete',function(filename){
|
||||||
|
@ -94,7 +96,6 @@ FileActions.setDefault('all','Download');
|
||||||
|
|
||||||
FileActions.register('dir','Open',function(filename){
|
FileActions.register('dir','Open',function(filename){
|
||||||
window.location='index.php?dir='+$('#dir').val()+'/'+filename;
|
window.location='index.php?dir='+$('#dir').val()+'/'+filename;
|
||||||
$('#file_menu').slideToggle(250);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
FileActions.setDefault('dir','Open');
|
FileActions.setDefault('dir','Open');
|
Loading…
Reference in New Issue