mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-09-23 10:22:05 +00:00
Prevent double-clicking on badge when initializing
Double-clicking would just recreate the badge midway while it is being created, and produce 2 popups simultaneously. This patch ignores the second click in a double-click until the widget is being replaced anyways. Bug: T184883 Change-Id: I2fda8df36b3828dbbe0d9b7892f159e598c630bd
This commit is contained in:
parent
38ec20ce27
commit
b2f2ef9114
|
@ -36,10 +36,12 @@
|
|||
var time = mw.now(),
|
||||
myType = $( this ).parent().prop( 'id' ) === 'pt-notifications-alert' ? 'alert' : 'message';
|
||||
|
||||
if ( e.which !== 1 ) {
|
||||
return;
|
||||
if ( e.which !== 1 || $( this ).data( 'clicked' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$( this ).data( 'clicked', true );
|
||||
|
||||
// Dim the button while we load
|
||||
$( this ).addClass( 'mw-echo-notifications-badge-dimmed' );
|
||||
|
||||
|
|
Loading…
Reference in a new issue