mw.ViewPageTarget.init: Don't add class ve-available when unavailable

In commit e1f8ee7 the return statement was moved into the
userPrefEnabled check, however addClass( 've-available' ) was
still unconditional. This has now been restored.

Change-Id: Ia59bfed93a8849a529cc3b9d1d2e0619d65240d4
This commit is contained in:
Timo Tijhof 2013-09-04 10:57:29 -07:00 committed by Krinkle
parent fc5003aa35
commit 298afbf337

View file

@ -404,16 +404,22 @@
// on this page. See above for why it may be false.
mw.libs.ve = init;
if ( !init.isAvailable ) {
if ( init.isAvailable ) {
$( 'html' ).addClass( 've-available' );
} else {
$( 'html' ).addClass( 've-not-available' );
// Don't return here because we do want the skin setup to consistently happen
// for e.g. "Edit" > "Edit source" even when VE is not available.
}
if ( !userPrefEnabled ) {
// However if ve is not available because of user preferences (as opposed
// to because of the page, namespace, browser etc.) then we do want to
// return early as in that case even transformation of edit source should
// not be done.
return;
}
$( 'html' ).addClass( 've-available' );
$( function () {
if ( init.isAvailable && isViewPage ) {
if ( uri.query.veaction === 'edit' ) {