From 27579f36f672181f0927e4f8bb1c4fd04345c28b Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 7 Oct 2013 13:11:34 +0200 Subject: [PATCH 1/3] Prevent scroll up when click on links in sharing dropdown When clicking on a link that points to "#" in the sharing dropdown, and the current view is scrolled down, the browser will scroll the page up to the top (anchor behavior). This fix cancels the click event when clicking on "unshare" link or "show crud" link. --- core/js/share.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/js/share.js b/core/js/share.js index 8d14520cd7..bbdc5a67e9 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -502,6 +502,7 @@ $(document).ready(function() { $(document).on('click', '#dropdown .showCruds', function() { $(this).parent().find('.cruds').toggle(); + return false; }); $(document).on('click', '#dropdown .unshare', function() { @@ -519,6 +520,7 @@ $(document).ready(function() { $('#expiration').hide(); } }); + return false; }); $(document).on('change', '#dropdown .permissions', function() { From 68fbd7b92241daf1326c9a95331d4fdb5ca030e6 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 7 Oct 2013 13:15:25 +0200 Subject: [PATCH 2/3] Fixed label for sharing notification to be clickable Fixed the sharing notification checkbox label in the file sharing dropdown, which makes it possible to click on the label directly. --- core/js/share.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/js/share.js b/core/js/share.js index bbdc5a67e9..c0ecbbf36c 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -350,7 +350,7 @@ OC.Share={ if (mailSend === '1') { checked = 'checked'; } - html += ''+t('core', 'notify user by email')+''; + html += ''; } if (possiblePermissions & OC.PERMISSION_CREATE || possiblePermissions & OC.PERMISSION_UPDATE || possiblePermissions & OC.PERMISSION_DELETE) { if (editChecked == '') { From e97aaee1aac6ab81d404e264b86b65357bda96ac Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 7 Oct 2013 13:25:30 +0200 Subject: [PATCH 3/3] Prevent share dropdown to close too early with autocomplete When clicking on an autocomplete result in the sharing dropdown, it will mistakenly be detected as being clicked outside and would trigger the sharing dropdown closing. This fix adds a check to detect clicks inside the autocomplete and prevent closing the dropdown in that case. This fixes #4142 --- core/js/share.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/js/share.js b/core/js/share.js index c0ecbbf36c..b472797b3c 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -476,7 +476,7 @@ $(document).ready(function() { $(this).click(function(event) { var target = $(event.target); var isMatched = !target.is('.drop, .ui-datepicker-next, .ui-datepicker-prev, .ui-icon') - && !target.closest('#ui-datepicker-div').length; + && !target.closest('#ui-datepicker-div').length && !target.closest('.ui-autocomplete').length; if (OC.Share.droppedDown && isMatched && $('#dropdown').has(event.target).length === 0) { OC.Share.hideDropDown(); }