jenkins-bot has submitted this change and it was merged.

Change subject: Ensure table cells are ce=true before computing offsets
......................................................................


Ensure table cells are ce=true before computing offsets

Firefox won't return an offset inside ce=false, and thus
breaks double-click to edit.

Bug: T128282
Change-Id: I0a4056a8daa9f41a35f98161118e4b352af27ba4
---
M src/ce/nodes/ve.ce.TableNode.js
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  DLynch: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/ce/nodes/ve.ce.TableNode.js b/src/ce/nodes/ve.ce.TableNode.js
index 437103e..e1d1a21 100644
--- a/src/ce/nodes/ve.ce.TableNode.js
+++ b/src/ce/nodes/ve.ce.TableNode.js
@@ -104,10 +104,12 @@
                return;
        }
        if ( this.surface.getModel().getSelection() instanceof 
ve.dm.TableSelection ) {
+               // Don't change selection in setEditing to avoid scrolling to 
bottom of cell
+               this.setEditing( true, true );
+               // getOffsetFromEventCoords doesn't work in ce=false in 
Firefox, so ensure
+               // this is called after setEditing( true ).
                offset = this.surface.getOffsetFromEventCoords( e.originalEvent 
);
                if ( offset !== -1 ) {
-                       // Don't change selection in setEditing to avoid 
scrolling to bottom of cell
-                       this.setEditing( true, true );
                        // Set selection to where the double click happened
                        this.surface.getModel().setLinearSelection( new 
ve.Range( offset ) );
                } else {

-- 
To view, visit https://gerrit.wikimedia.org/r/277104
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0a4056a8daa9f41a35f98161118e4b352af27ba4
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: DLynch <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to