mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
Merge "DesktopArticleTarget.init: always bind to #ca-edit"
This commit is contained in:
commit
c0c94668c9
|
@ -686,8 +686,14 @@
|
|||
// Allow instant switching to edit mode, without refresh
|
||||
$caVeEdit.off( '.ve-target' ).on( 'click.ve-target', init.onEditTabClick.bind( init, 'visual' ) );
|
||||
}
|
||||
if ( pageCanLoadEditor ) {
|
||||
// Always bind "Edit source" tab, because we want to handle switching with changes
|
||||
$caEdit.off( '.ve-target' ).on( 'click.ve-target', init.onEditTabClick.bind( init, 'source' ) );
|
||||
}
|
||||
if ( pageCanLoadEditor && init.isWikitextAvailable ) {
|
||||
$caEdit.add( '#ca-addsection' ).off( '.ve-target' ).on( 'click.ve-target', init.onEditTabClick.bind( init, 'source' ) );
|
||||
// Only bind "Add topic" tab if NWE is available, because VE doesn't support section
|
||||
// so we never have to switch from it when editing a section
|
||||
$( '#ca-addsection' ).off( '.ve-target' ).on( 'click.ve-target', init.onEditTabClick.bind( init, 'source' ) );
|
||||
}
|
||||
|
||||
// Alter the edit tab (#ca-edit)
|
||||
|
@ -791,6 +797,12 @@
|
|||
if ( !init.isUnmodifiedLeftClick( e ) ) {
|
||||
return;
|
||||
}
|
||||
if ( !active && mode === 'source' && !init.isWikitextAvailable ) {
|
||||
// We're not active so we don't need to manage a switch, and
|
||||
// we don't have source mode available so we don't need to
|
||||
// activate VE. Just follow the link.
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
if ( isLoading ) {
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue