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

Change subject: Associate the fragment in AnnotationInspector
......................................................................


Associate the fragment in AnnotationInspector

We are manipulating the selection and fragment in the getSetupProcess
and we need to store and replace the original fragment with the new
one. This will also mean that on teardown we can refer to the actual
selection rather than an old one.

Also make sure that whenever we return/leave the teardown process
we are popping the staging.

Bug: T93363
Change-Id: Ic5802b2a249f48686387aa05a6ead6d8ac0965bb
---
M src/ui/inspectors/ve.ui.AnnotationInspector.js
1 file changed, 8 insertions(+), 2 deletions(-)

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



diff --git a/src/ui/inspectors/ve.ui.AnnotationInspector.js 
b/src/ui/inspectors/ve.ui.AnnotationInspector.js
index 29aa526..c35a0bd 100644
--- a/src/ui/inspectors/ve.ui.AnnotationInspector.js
+++ b/src/ui/inspectors/ve.ui.AnnotationInspector.js
@@ -239,6 +239,8 @@
                                this.initialAnnotationIsCovering = true;
                        }
 
+                       this.fragment = fragment;
+
                        // Set the mode - this was done already in 
FragmentInspector but now that we may have
                        // changed what the fragment is covering we need to run 
it again
                        this.actions.setMode( this.getMode() );
@@ -258,20 +260,24 @@
                                replace = false,
                                annotation = this.getAnnotation(),
                                remove = this.shouldRemoveAnnotation() || 
data.action === 'remove',
-                               surfaceModel = this.getFragment().getSurface(),
+                               surfaceModel = this.fragment.getSurface(),
                                fragment = surfaceModel.getFragment( 
this.initialSelection, false ),
-                               selection = this.getFragment().getSelection();
+                               selection = this.fragment.getSelection();
 
                        if (
                                !( selection instanceof ve.dm.LinearSelection ) 
||
                                ( remove && selection.getRange().isCollapsed() )
                        ) {
+                               // Since we pushStaging on SetupProcess we need 
to make sure
+                               // all terminations pop
+                               surfaceModel.popStaging();
                                return;
                        }
 
                        if ( !remove ) {
                                if ( this.initialSelection.isCollapsed() ) {
                                        if ( data.action !== 'done' ) {
+                                               surfaceModel.popStaging();
                                                return;
                                        }
                                        insertText = true;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic5802b2a249f48686387aa05a6ead6d8ac0965bb
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: wmf/1.25wmf22
Gerrit-Owner: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: Mooeypoo <mor...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to