diff options
author | Michael Gapczynski <GapczynskiM@gmail.com> | 2011-08-11 11:52:10 -0400 |
---|---|---|
committer | Michael Gapczynski <GapczynskiM@gmail.com> | 2011-08-11 11:52:10 -0400 |
commit | 0f91438b802343060d147d5a5bba2367cabdb1c9 (patch) | |
tree | e8561faeccc87c35a8feb46faa46fdf458c50cd5 | |
parent | 2af0269eb93c4511edbb300a43795e0b3c0e2209 (diff) | |
download | nextcloud-server-0f91438b802343060d147d5a5bba2367cabdb1c9.tar.gz nextcloud-server-0f91438b802343060d147d5a5bba2367cabdb1c9.zip |
Don't spawn a new dropdown if there is already one open
-rw-r--r-- | apps/files_sharing/js/share.js | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 9cf3f5f6589..b5aef4068e7 100644 --- a/apps/files_sharing/js/share.js +++ b/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'); |