]> source.dussan.org Git - nextcloud-server.git/commitdiff
Prevent monkey clicking on labels
authorVincent Petry <pvince81@owncloud.com>
Fri, 26 Sep 2014 15:06:16 +0000 (17:06 +0200)
committerVincent Petry <pvince81@owncloud.com>
Fri, 26 Sep 2014 15:07:14 +0000 (17:07 +0200)
Clicking on labels while the spinner is there will not trigger the
hidden checkbox any more.

core/js/share.js

index 3341c56295ca7a72e8b608c16f57c6d26ffcc212..5632ecba97168d575a7dac360aa7d393656dca14 100644 (file)
@@ -920,9 +920,12 @@ $(document).ready(function() {
                        if (oc_appconfig.core.enforcePasswordForPublicLink === false) {
                                $loading.removeClass('hidden');
                                $button.addClass('hidden');
+                               $button.prop('disabled', true);
+
                                OC.Share.share(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, '', OC.PERMISSION_READ, itemSourceName, expireDateString, function(data) {
                                        $loading.addClass('hidden');
                                        $button.removeClass('hidden');
+                                       $button.prop('disabled', false);
                                        OC.Share.showLink(data.token, null, itemSource);
                                        $('#dropdown').trigger(new $.Event('sharesChanged', {shares: OC.Share.currentShares}));
                                        OC.Share.updateIcon(itemType, itemSource);
@@ -941,9 +944,11 @@ $(document).ready(function() {
                        if ($('#linkText').val() !== '') {
                                $loading.removeClass('hidden');
                                $button.addClass('hidden');
+                               $button.prop('disabled', true);
                                OC.Share.unshare(itemType, itemSource, OC.Share.SHARE_TYPE_LINK, '', function() {
                                        $loading.addClass('hidden');
                                        $button.removeClass('hidden');
+                                       $button.prop('disabled', false);
                                        OC.Share.itemShares[OC.Share.SHARE_TYPE_LINK] = false;
                                        $('#dropdown').trigger(new $.Event('sharesChanged', {shares: OC.Share.currentShares}));
                                        OC.Share.updateIcon(itemType, itemSource);