Index: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.js |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | * AJAX code for Special:MoodBarFeedback |
4 | 4 | */ |
5 | 5 | jQuery( document ).ready( function ( $ ) { |
6 | | - var formState, filterType, $fbdFiltersCheck; |
| 6 | + var formState, filterType, $fbdFiltersCheck, concurrencyState = []; |
7 | 7 | |
8 | 8 | /** |
9 | 9 | * Saved form state |
— | — | @@ -413,7 +413,8 @@ |
414 | 414 | $( '.fbd-response-preview, .fbd-response-submit' ).removeProp( 'disabled' ); |
415 | 415 | $( this ).find( '.fbd-response-form' ).remove(); |
416 | 416 | } |
417 | | - |
| 417 | + //remove ConcurrencyToolTip if any |
| 418 | + $( this ).find( '.fbd-tooltip-overlay-wrap').remove(); |
418 | 419 | }); |
419 | 420 | } |
420 | 421 | |
— | — | @@ -423,7 +424,7 @@ |
424 | 425 | * @param e {jQuery.Event} |
425 | 426 | */ |
426 | 427 | function showResponseForm( e ) { |
427 | | - var termsLink, ula, inlineForm, $item; |
| 428 | + var termsLink, ula, inlineForm, $item, itemId; |
428 | 429 | |
429 | 430 | if ( $(this).hasClass( 'responder-expanded' ) ) { |
430 | 431 | |
— | — | @@ -542,13 +543,16 @@ |
543 | 544 | |
544 | 545 | //check for concurrency module. |
545 | 546 | if( typeof $.concurrency !== 'undefined') { |
| 547 | + itemId = $item.data( 'mbccontinue' ).split( '|' )[1]; |
546 | 548 | //concurrency module is here, attempt checkout |
547 | 549 | $.concurrency.check( { |
548 | 550 | ccaction: 'checkout', |
549 | 551 | resourcetype: 'moodbar-feedback-response', |
550 | | - record: $item.data( 'mbccontinue' ).split( '|' )[1] |
| 552 | + record: itemId |
551 | 553 | }, function( result ){ |
552 | | - if( result == 'failure' ) { //checkout failed, show tooltip |
| 554 | + //if checkout failed, show tooltip if it hasn't been shown |
| 555 | + if( result == 'failure' && $.inArray( itemId, concurrencyState ) === -1 ) { |
| 556 | + concurrencyState.push(itemId); |
553 | 557 | loadConcurrencyToolTip($item); |
554 | 558 | } |
555 | 559 | } ); |