jenkins-bot has submitted this change and it was merged.
Change subject: Make cursoring over a FocusableNode work again
......................................................................
Make cursoring over a FocusableNode work again
When you cursor onto a FocusableNode, it's selected, and we focus the
paste target as part of our hack to make copying FocusableNodes work
in Firefox. But then when you press the arrow key again, that event
isn't picked up by anything, and you can't move the cursor off the
FocusableNode using the keyboard.
Fixed by attaching the EventSequencer to this.$ (which is the parent
of $documentNode and $pasteTarget) and listening for focus/blur on
both $documentNode and $pasteTarget.
Bug: 54443
Change-Id: I7bddcfa9fa6f38908e315c97623bd27133daa98d
---
M modules/ve/ce/ve.ce.Surface.js
1 file changed, 5 insertions(+), 2 deletions(-)
Approvals:
Divec: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/ve/ce/ve.ce.Surface.js b/modules/ve/ce/ve.ce.Surface.js
index e85000a..631c91c 100644
--- a/modules/ve/ce/ve.ce.Surface.js
+++ b/modules/ve/ce/ve.ce.Surface.js
@@ -70,7 +70,10 @@
} );
this.$pasteTarget.on( {
'cut': ve.bind( this.onCut, this ),
- 'copy': ve.bind( this.onCopy, this )
+ 'copy': ve.bind( this.onCopy, this ),
+ // $pasteTarget is focused when selecting a FocusableNode
+ 'focus': ve.bind( this.documentOnFocus, this ),
+ 'blur': ve.bind( this.documentOnBlur, this )
} );
$documentNode.on( $.browser.msie ? 'beforepaste' : 'paste', ve.bind(
this.onPaste, this ) );
$documentNode.on( 'focus', 'a', function () {
@@ -326,7 +329,7 @@
* @param {jQuery.Event} e Focus event
*/
ve.ce.Surface.prototype.documentOnFocus = function () {
- this.eventSequencer.attach( this.$document );
+ this.eventSequencer.attach( this.$ );
this.surfaceObserver.startTimerLoop();
};
--
To view, visit https://gerrit.wikimedia.org/r/86788
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7bddcfa9fa6f38908e315c97623bd27133daa98d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Divec <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits