Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/277104

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/04/277104/1

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: newchange
Gerrit-Change-Id: I0a4056a8daa9f41a35f98161118e4b352af27ba4
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

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

Reply via email to