Robmoen has uploaded a new change for review. https://gerrit.wikimedia.org/r/206191
Change subject: Prevent multiple clicks to flag and detach from dom on confirmation ...................................................................... Prevent multiple clicks to flag and detach from dom on confirmation Change-Id: I9a159557449d1712993bcfe3a17214fd739e571b --- M resources/ext.gather.special/init.js 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gather refs/changes/91/206191/1 diff --git a/resources/ext.gather.special/init.js b/resources/ext.gather.special/init.js index 6923d77..cdcc32f 100644 --- a/resources/ext.gather.special/init.js +++ b/resources/ext.gather.special/init.js @@ -20,15 +20,18 @@ var flagOverlay; ev.stopPropagation(); ev.preventDefault(); + if ( !$flag.hasClass( 'disabled' ) ) { + // Prevent multiple clicks + $flag.addClass( 'disabled' ); api.getCollection( $collection.data( 'id' ) ).done( function ( collection ) { flagOverlay = new CollectionFlagOverlay( { collection: collection } ); flagOverlay.show(); flagOverlay.on( 'collection-flagged', function () { - // After flagging, prevent click from opening flag confirmation again - $flag.addClass( 'disabled' ); + // After flagging, remove flag icon. + $flag.detach(); } ); } ); } -- To view, visit https://gerrit.wikimedia.org/r/206191 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9a159557449d1712993bcfe3a17214fd739e571b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Gather Gerrit-Branch: master Gerrit-Owner: Robmoen <rm...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits