Don't spawn a new dropdown if there is already one open

remotes/origin/stable
Michael Gapczynski 15 years ago
parent 2af0269eb9
commit 0f91438b80
  1. 24
      apps/files_sharing/js/share.js

@ -1,7 +1,16 @@
$(document).ready(function() {
if (typeof FileActions !== 'undefined') {
FileActions.register('all', 'Share', OC.imagePath('core', 'actions/share'), function(filename) {
createDropdown(filename, $('#dir').val()+'/'+filename);
if ($('#dropdown').length != 0) {
$('#dropdown').hide('blind', function() {
$('#dropdown').remove();
$('tr').removeClass('mouseOver');
createDropdown(filename, $('#dir').val()+'/'+filename);
});
} else {
createDropdown(filename, $('#dir').val()+'/'+filename);
}
});
};
@ -15,17 +24,6 @@ $(document).ready(function() {
}
createDropdown(false, files);
});
$(this).click(function(event) {
if ($(event.target).parents().index($('#dropdown')) == -1) {
if ($('#dropdown').is(':visible')) {
$('#dropdown').hide('blind', function() {
$('#dropdown').remove();
$('tr').removeClass('mouseOver');
});
}
}
});
$(this).click(function(event) {
if ($(event.target).parents().index($('#dropdown')) == -1) {
@ -177,7 +175,7 @@ function createDropdown(filename, files) {
$('#makelink').attr('checked', true);
$('#link').data('token', token);
$('#link').val('http://'+location.host+OC.linkTo('files_publiclink','get.php')+'?token='+token);
$('#link').show('blind');
$('#link').show();
}
});
$('#dropdown').show('blind');

Loading…
Cancel
Save