Previously clicking the watch link several times in a row would fire
several requests to the API, and the final result would depend on the
order in which they arrived. Let's not allow that.
This also removes the special-case for the 'loading' class, it is now
always added or removed.
Change-Id: Ib91ec8505d04945dc77e48ab70b5c94e3da47d9c
$li.prop( 'id', 'ca-' + action );
}
- // Special case for vector icon
- if ( $li.hasClass( 'icon' ) ) {
- if ( state === 'loading' ) {
- $link.addClass( 'loading' );
- } else {
- $link.removeClass( 'loading' );
- }
+ if ( state === 'loading' ) {
+ $link.addClass( 'loading' );
+ } else {
+ $link.removeClass( 'loading' );
}
}
$link = $( this );
+ if ( $link.hasClass( 'loading' ) ) {
+ return;
+ }
+
updateWatchLink( $link, action, 'loading' );
api = new mw.Api();
.rotation(700ms);
/* Suppress the hilarious rotating focus outline on Firefox */
outline: none;
+ cursor: default;
+ pointer-events: none;
background-position: 50% 60%;
-webkit-transform-origin: 50% 57%;
transform-origin: 50% 57%;