mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 14:33:59 +00:00
Improve deactivating tabs when switching/exiting on MonoBook etc.
Previously we didn't deactivate them, so if you opened VE, then switched to NWE, then exited the editor, all three tabs would appear active. Change-Id: I904d6daf2896ceadf004f5e57a88c2359f33fd44
This commit is contained in:
parent
e31c60c63c
commit
61de7530c7
|
@ -316,10 +316,6 @@ ve.init.mw.ArticleTarget.prototype.setDefaultMode = function () {
|
|||
ve.init.mw.ArticleTarget.prototype.updateTabs = function ( editing ) {
|
||||
var $tab;
|
||||
|
||||
// Deselect current mode (e.g. "view" or "history"). In skins like monobook that don't have
|
||||
// separate tab sections for content actions and namespaces the below is a no-op.
|
||||
$( '#p-views' ).find( 'li.selected' ).removeClass( 'selected' );
|
||||
|
||||
if ( editing ) {
|
||||
if ( this.section === 'new' ) {
|
||||
$tab = $( '#ca-addsection' );
|
||||
|
@ -336,6 +332,14 @@ ve.init.mw.ArticleTarget.prototype.updateTabs = function ( editing ) {
|
|||
} else {
|
||||
$tab = $( '#ca-view' );
|
||||
}
|
||||
|
||||
// Deselect current mode (e.g. "view" or "history") in skins that have
|
||||
// separate tab sections for content actions and namespaces, like Vector.
|
||||
$( '#p-views' ).find( 'li.selected' ).removeClass( 'selected' );
|
||||
// In skins like MonoBook that don't have the separate tab sections,
|
||||
// deselect the known tabs for editing modes (when switching or exiting editor).
|
||||
$( '#ca-edit, #ca-ve-edit, #ca-addsection' ).not( $tab ).removeClass( 'selected' );
|
||||
|
||||
$tab.addClass( 'selected' );
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue