From e366c3668cbf8653a199a71fa8c865f5182f46e4 Mon Sep 17 00:00:00 2001 From: Krinkle Date: Fri, 14 Dec 2012 21:02:06 +0000 Subject: [PATCH] Revert "Adding ability of jQuery badge to display the number zero if requested." This reverts commit b170b56f09d1ec5ab5e34e997447546239e008fd --- resources/jquery/jquery.badge.css | 9 ++------- resources/jquery/jquery.badge.js | 19 +++---------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/resources/jquery/jquery.badge.css b/resources/jquery/jquery.badge.css index 9f446285ac..7dd2198e62 100644 --- a/resources/jquery/jquery.badge.css +++ b/resources/jquery/jquery.badge.css @@ -6,6 +6,7 @@ -moz-box-shadow: 0px 1px 4px #ccc; -webkit-box-shadow: 0px 1px 4px #ccc; box-shadow: 0px 1px 4px #ccc; + background-color: #cc0000; padding: 0 3px; text-align: center; font-size: 12px; @@ -23,16 +24,10 @@ display: inline-block; margin-left: 3px; } + .mw-badge-overlay { position: absolute; bottom: -1px; right: -3px; z-index: 50; } - -.mw-badge-red { - background-color: #cc0000; -} -.mw-badge-grey { - background-color: #d2d2d2; -} diff --git a/resources/jquery/jquery.badge.js b/resources/jquery/jquery.badge.js index 8a1f2988eb..c8073d1756 100644 --- a/resources/jquery/jquery.badge.js +++ b/resources/jquery/jquery.badge.js @@ -31,30 +31,17 @@ * null, false, '', etc.), any existing badge will be removed. * @param boolean inline True if the badge should be displayed inline, false * if the badge should overlay the parent element (default is inline) - * @param boolean displayZero True if the number zero should be displayed, - * false if the number zero should result in the badge being hidden - * (default is zero will result in the badge being hidden) */ - $.fn.badge = function ( text, inline, displayZero ) { - var $badge = this.find( '.mw-badge' ), - badgeStyleClass = 'mw-badge-' + ( inline ? 'inline' : 'overlay' ), - badgeColorClass = 'mw-badge-red'; // default color is red + $.fn.badge = function ( text, inline ) { + var $badge = this.find( '.mw-badge' ); - // If we're displaying zero, change the color to grey - if ( displayZero && text === 0 ) { - badgeColorClass = 'mw-badge-grey'; - // Change zero to string so that it will be displayed - text = '0'; - } if ( text ) { // If a badge already exists, reuse it if ( $badge.length ) { $badge.find( '.mw-badge-content' ).text( text ); } else { // Otherwise, create a new badge with the specified text and style - $badge = $( '
' ) - .addClass( badgeStyleClass ) - .addClass( badgeColorClass ) + $badge = $( '
' ) .append( $( '' ).text ( text ) ) .appendTo( this ); } -- 2.20.1