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

Change subject: Only run showSelection if one of the command successfully 
executed
......................................................................


Only run showSelection if one of the command successfully executed

Change-Id: I1192fcdca79c202559f99ccebc2f0ccbc8501f5c
---
M src/ce/ve.ce.Surface.js
1 file changed, 3 insertions(+), 2 deletions(-)

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



diff --git a/src/ce/ve.ce.Surface.js b/src/ce/ve.ce.Surface.js
index 110fe4c..0ead9ae 100644
--- a/src/ce/ve.ce.Surface.js
+++ b/src/ce/ve.ce.Surface.js
@@ -2331,6 +2331,7 @@
  */
 ve.ce.Surface.prototype.checkSequences = function () {
        var i, sequences,
+               executed = false,
                surfaceModel = this.surface.getModel(),
                selection = surfaceModel.getSelection();
 
@@ -2342,9 +2343,9 @@
 
        // sequences.length will likely be 0 or 1 so don't cache
        for ( i = 0; i < sequences.length; i++ ) {
-               sequences[i].execute( this.surface );
+               executed = sequences[i].execute( this.surface ) || executed;
        }
-       if ( sequences.length > 0 ) {
+       if ( executed ) {
                this.showSelection( this.surface.getModel().getSelection() );
        }
 };

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

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

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

Reply via email to