]> source.dussan.org Git - nextcloud-server.git/commitdiff
Prevent scroll up when click on links in sharing dropdown
authorVincent Petry <pvince81@owncloud.com>
Mon, 7 Oct 2013 11:11:34 +0000 (13:11 +0200)
committerVincent Petry <pvince81@owncloud.com>
Mon, 7 Oct 2013 11:11:34 +0000 (13:11 +0200)
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

index 8d14520cd74650934b691495dcdbc04b3ebadd64..bbdc5a67e9da4aa994636ac20b4fe31e26f3608a 100644 (file)
@@ -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() {