Index: trunk/phase3/resources/mediawiki.page/mediawiki.page.ajaxCategories.js |
— | — | @@ -445,13 +445,8 @@ |
446 | 446 | * @return {jQuery} |
447 | 447 | */ |
448 | 448 | createCatLink: function( catTitle ) { |
449 | | - var catName = catTitle.getMainText(); |
450 | | - |
451 | | - if ( this.containsCat( catName ) ) { |
452 | | - return; |
453 | | - } |
454 | | - |
455 | | - var $catLinkWrapper = $( this.options.catLinkWrapper ), |
| 449 | + var catName = catTitle.getMainText(), |
| 450 | + $catLinkWrapper = $( this.options.catLinkWrapper ), |
456 | 451 | $anchor = $( '<a>' ) |
457 | 452 | .text( catName ) |
458 | 453 | .attr( { |
— | — | @@ -528,20 +523,13 @@ |
529 | 524 | catName = catTitle.getMainText(), |
530 | 525 | catFull = catTitle.toText(); |
531 | 526 | |
532 | | - if ( !$link.length ) { |
533 | | - $link = this.createCatLink( catTitle ); |
534 | | - } |
535 | | - |
536 | 527 | if ( this.containsCat( catName ) ) { |
537 | 528 | this.showError( mw.msg( 'ajax-category-already-present', catName ) ); |
538 | 529 | return this; |
539 | 530 | } |
540 | 531 | |
541 | | - // Sometimes createCatLink returns undefined/null, previously caused an exception |
542 | | - // in the following lines, catching now.. @todo |
543 | | - if ( !$link ) { |
544 | | - this.showError( 'Unexpected error occurred. $link undefined.' ); |
545 | | - return this; |
| 532 | + if ( !$link.length ) { |
| 533 | + $link = this.createCatLink( catTitle ); |
546 | 534 | } |
547 | 535 | |
548 | 536 | // Mark red if missing |