r103132 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103131‎ | r103132 | r103133 >
Date:06:37, 15 November 2011
Author:santhosh
Status:ok
Tags:
Comment:
Along with checking the font from cookie is available, check for 'none' too. Otherwise 'reset' option will not be remembered across pages.
Modified paths:
  • /trunk/extensions/WebFonts/resources/ext.webfonts.js (modified) (history)

Diff [purge]

Index: trunk/extensions/WebFonts/resources/ext.webfonts.js
@@ -183,7 +183,7 @@
184184 var cookieFont = $.cookie( 'webfonts-font' );
185185 var selectedFont = null;
186186 // check whether this font is for the current userlang/contentlang
187 - if ( $.inArray( cookieFont, config ) !== -1 ) {
 187+ if ( $.inArray( cookieFont, config ) !== -1 || cookieFont === 'none' ) {
188188 selectedFont = cookieFont;
189189 }
190190 else{
@@ -191,7 +191,7 @@
192192 // for current language.
193193 selectedFont = config[0];
194194 }
195 - if ( selectedFont && selectedFont !== 'none' ) {
 195+ if ( selectedFont ) {
196196 mw.webfonts.set( selectedFont );
197197 // Mark it as checked
198198 $( '#'+fontID( selectedFont ) ).prop( 'checked', true );

Status & tagging log