summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r--apps/files_sharing/js/share.js24
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');