mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-24 02:38:40 +00:00
Don't change tabs on Education Program pages
Unfortunately the best way I've come up with to do this so far is checking the namespace. Bug: 53477 Change-Id: Ib2dbe91aff516f2d2408e07ff3f73ea861bfcbe2
This commit is contained in:
parent
3dc9a388a3
commit
e3be4a6588
|
@ -68,6 +68,9 @@ class VisualEditorHooks {
|
|||
return true;
|
||||
}
|
||||
$title = $skin->getRelevantTitle();
|
||||
if ( defined( 'EP_NS' ) && $title->inNamespace( EP_NS ) ) {
|
||||
return true;
|
||||
}
|
||||
// Rebuild the $links['views'] array and inject the VisualEditor tab before or after
|
||||
// the edit tab as appropriate. We have to rebuild the array because PHP doesn't allow
|
||||
// us to splice into the middle of an associative array.
|
||||
|
|
|
@ -155,6 +155,15 @@
|
|||
},
|
||||
|
||||
setupTabs: function () {
|
||||
// HACK: Remove this when the Education Program offers a proper way to detect and disable.
|
||||
if (
|
||||
mw.config.get( 'wgNamespaceIds' ).hasOwnProperty( 'education_program' ) &&
|
||||
/*jshint -W069*/
|
||||
mw.config.get( 'wgNamespaceIds' )['education_program'] === mw.config.get( 'wgNamespaceNumber' )
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
var caVeEdit,
|
||||
action = pageExists ? 'edit' : 'create',
|
||||
pTabsId = $( '#p-views' ).length ? 'p-views' : 'p-cactions',
|
||||
|
|
Loading…
Reference in a new issue