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
(cherry picked from commit 08bebc9b2b8672dcad310ac20e96c05f59168c4a)
---
M modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
1 file changed, 11 insertions(+), 4 deletions(-)
Approvals:
Krinkle: 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 38888b1..735e171 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;
@@ -245,11 +249,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();
@@ -334,7 +337,7 @@
this.restorePage();
this.showReadOnlyContent();
- $( document ).off( 'keydown', this.onDocumentKeyDownHandler );
+ this.unbindHandlers();
mw.user.options.set( 'editondblclick', this.originalEditondbclick );
this.originalEditondbclick = undefined;
@@ -463,7 +466,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/180575
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0739e71781c5140c54512ab421bdcb6d1df5fbbe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: wmf/1.25wmf13
Gerrit-Owner: Jforrester <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits