(bug 29567) mw.util.addPortletLink should only wrap link in <span> for "vectorTabs...
authorKrinkle <krinkle@users.mediawiki.org>
Fri, 24 Jun 2011 19:52:35 +0000 (19:52 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Fri, 24 Jun 2011 19:52:35 +0000 (19:52 +0000)
* Patch by Erwin Dokter
* This unbreaks test introduced in r90728

resources/mediawiki/mediawiki.util.js

index 1f4d95f..189046f 100644 (file)
                                // Unhide portlet if it was hidden before
                                $portlet.removeClass( 'emptyPortlet' );
 
-                               // Wrap the anchor tag in a <span> and create a list item for it
+                               // Wrap the anchor tag in a list item (and a span if $portlet is a Vector tab)
                                // and back up the selector to the list item
-                               var $item = $link.wrap( '<li><span></span></li>' ).parent().parent();
+                               var $item;
+                               if ( $portlet.hasClass( 'vectorTabs' ) ) {
+                                       $item = $link.wrap( '<li><span></span></li>' ).parent().parent();
+                               } else {
+                                       $item = $link.wrap( '<li></li>' ).parent();
+                               }
 
                                // Implement the properties passed to the function
                                if ( id ) {