[MediaWiki-commits] [Gerrit] Collapse table selection when pressing escape - change (VisualEditor/VisualEditor)

2015-11-26 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Collapse table selection when pressing escape
..


Collapse table selection when pressing escape

This only matters for merged selections, where future cell-selection
movement via arrow keys is affected by the "intended" selection
covering the entire merged cell range. It seems more intuitive to
reset the selection to the top-left point of the merged cell instead.

Change-Id: I7d602d2ab1e4ff214a5d8b0e08789a7d977f902e
---
M src/ce/keydownhandlers/ve.ce.LinearEscapeKeyDownHandler.js
1 file changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/src/ce/keydownhandlers/ve.ce.LinearEscapeKeyDownHandler.js 
b/src/ce/keydownhandlers/ve.ce.LinearEscapeKeyDownHandler.js
index a26a963..d492712 100644
--- a/src/ce/keydownhandlers/ve.ce.LinearEscapeKeyDownHandler.js
+++ b/src/ce/keydownhandlers/ve.ce.LinearEscapeKeyDownHandler.js
@@ -42,7 +42,9 @@
e.preventDefault();
e.stopPropagation();
tableNode.setEditing( false );
-
+   // if this was a merged cell, we're going to have unexpected 
behavior when the selection moves,
+   // so pre-emptatively collapse to the top-left point of the 
merged cell.
+   surface.getModel().setSelection( 
surface.getModel().getSelection().collapseToStart() );
return true;
}
return false;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7d602d2ab1e4ff214a5d8b0e08789a7d977f902e
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: DLynch 
Gerrit-Reviewer: DLynch 
Gerrit-Reviewer: Esanders 
Gerrit-Reviewer: Jforrester 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Collapse table selection when pressing escape - change (VisualEditor/VisualEditor)

2015-11-25 Thread DLynch (Code Review)
DLynch has uploaded a new change for review.

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

Change subject: Collapse table selection when pressing escape
..

Collapse table selection when pressing escape

This only matters for merged selections, where future cell-selection
movement via arrow keys is affected by the "intended" selection
covering the entire merged cell range. It seems more intuitive to
reset the selection to the top-left point of the merged cell instead.

Change-Id: I7d602d2ab1e4ff214a5d8b0e08789a7d977f902e
---
M src/ce/keydownhandlers/ve.ce.LinearEscapeKeyDownHandler.js
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/94/255494/1

diff --git a/src/ce/keydownhandlers/ve.ce.LinearEscapeKeyDownHandler.js 
b/src/ce/keydownhandlers/ve.ce.LinearEscapeKeyDownHandler.js
index a26a963..d492712 100644
--- a/src/ce/keydownhandlers/ve.ce.LinearEscapeKeyDownHandler.js
+++ b/src/ce/keydownhandlers/ve.ce.LinearEscapeKeyDownHandler.js
@@ -42,7 +42,9 @@
e.preventDefault();
e.stopPropagation();
tableNode.setEditing( false );
-
+   // if this was a merged cell, we're going to have unexpected 
behavior when the selection moves,
+   // so pre-emptatively collapse to the top-left point of the 
merged cell.
+   surface.getModel().setSelection( 
surface.getModel().getSelection().collapseToStart() );
return true;
}
return false;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7d602d2ab1e4ff214a5d8b0e08789a7d977f902e
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: DLynch 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits