jenkins-bot has submitted this change and it was merged.
Change subject: VE-MW fix commit for I4efbae614e
......................................................................
VE-MW fix commit for I4efbae614e
Local changes:
* Call bindHandlers()/unbindHandlers() in activate/deactivate
* Extend onDocumentKeyDown rather than overwriting it
Change-Id: I0739e71781c5140c54512ab421bdcb6d1df5fbbe
---
M modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
1 file changed, 11 insertions(+), 4 deletions(-)
Approvals:
Jforrester: Looks good to me, approved
Esanders: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
index 5c1f820..e1e6954 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
@@ -25,6 +25,10 @@
// Parent constructor
ve.init.mw.Target.call( this, mw.config.get( 'wgRelevantPageName' ),
currentUri.query.oldid );
+ // Parent constructor bound key event handlers, but we don't want them
bound until
+ // we activate; so unbind them again
+ this.unbindHandlers();
+
// Properties
this.toolbarSaveButton = null;
this.saveDialog = null;
@@ -246,11 +250,10 @@
this.activating = true;
this.activatingDeferred = $.Deferred();
+ this.bindHandlers();
+
this.originalEditondbclick = mw.user.options.get(
'editondblclick' );
mw.user.options.set( 'editondblclick', 0 );
-
- this.onDocumentKeyDownHandler = this.onDocumentKeyDown.bind(
this );
- $( document ).on( 'keydown', this.onDocumentKeyDownHandler );
// User interface changes
this.transformPage();
@@ -333,7 +336,7 @@
this.restorePage();
this.showReadOnlyContent();
- $( document ).off( 'keydown', this.onDocumentKeyDownHandler );
+ this.unbindHandlers();
mw.user.options.set( 'editondblclick', this.originalEditondbclick );
this.originalEditondbclick = undefined;
@@ -462,7 +465,11 @@
* @param {jQuery.Event} e Keydown event
*/
ve.init.mw.ViewPageTarget.prototype.onDocumentKeyDown = function ( e ) {
+ // Parent method
+ ve.init.mw.ViewPageTarget.super.prototype.onDocumentKeyDown.apply(
this, arguments );
+
var target = this;
+
if ( e.which === OO.ui.Keys.ESCAPE ) {
setTimeout( function () {
// Listeners should stopPropagation if they handle the
escape key, but
--
To view, visit https://gerrit.wikimedia.org/r/179387
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0739e71781c5140c54512ab421bdcb6d1df5fbbe
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits