mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
DesktopArticleTarget: view click handler should only run for active target
Not checking this results in handlers blocking click actions for "read" after the teardown of the target. Bug: T197445 Change-Id: I3a962c66c82a0e48ca54bf2f0b822a9a005da54c
This commit is contained in:
parent
ad339f61aa
commit
814e26f1e9
|
@ -931,7 +931,7 @@ ve.init.mw.DesktopArticleTarget.prototype.onDocumentKeyDown = function ( e ) {
|
|||
* @param {jQuery.Event} e Mouse click event
|
||||
*/
|
||||
ve.init.mw.DesktopArticleTarget.prototype.onViewTabClick = function ( e ) {
|
||||
if ( !ve.isUnmodifiedLeftClick( e ) ) {
|
||||
if ( ( !this.active && !this.activating ) || !ve.isUnmodifiedLeftClick( e ) ) {
|
||||
return;
|
||||
}
|
||||
this.tryTeardown( false, 'navigate-read' );
|
||||
|
@ -1104,11 +1104,11 @@ ve.init.mw.DesktopArticleTarget.prototype.setupSkinTabs = function () {
|
|||
}
|
||||
// Allow instant switching back to view mode, without refresh
|
||||
$( '#ca-view a, #ca-nstab-' + namespaceKey + ' a' )
|
||||
.on( 'click', this.onViewTabClick.bind( this ) );
|
||||
.on( 'click.ve-target', this.onViewTabClick.bind( this ) );
|
||||
|
||||
}
|
||||
if ( !mw.libs.ve.isSingleEditTab ) {
|
||||
$( '#ca-viewsource, #ca-edit' ).on( 'click', function ( e ) {
|
||||
$( '#ca-viewsource, #ca-edit' ).on( 'click.ve-target', function ( e ) {
|
||||
if ( !target.active || !ve.isUnmodifiedLeftClick( e ) ) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue