mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeEditor
synced 2024-11-23 23:03:46 +00:00
Check for numeric 0 when checking 'usecodeeditor' pref in JS
A recent core change caused zero-valued preferences to start being returned as numeric 0 rather than string 0. See the linked bug for details. Bug: T161875 Change-Id: I183fd9944e65041b0a330725c41fec2b59ca8379
This commit is contained in:
parent
9b6f81e832
commit
fe072480d3
|
@ -104,7 +104,8 @@
|
|||
}
|
||||
} );
|
||||
|
||||
context.codeEditorActive = mw.user.options.get( 'usecodeeditor' ) !== '0';
|
||||
// Make sure to cast '0' to false
|
||||
context.codeEditorActive = !!Number( mw.user.options.get( 'usecodeeditor' ) );
|
||||
|
||||
/**
|
||||
* Internally used functions
|
||||
|
|
Loading…
Reference in a new issue