Esanders has uploaded a new change for review.
https://gerrit.wikimedia.org/r/73896
Change subject: Compare annotations by name only when clearing/toggling
......................................................................
Compare annotations by name only when clearing/toggling
Otherwise links don't get removed as an empty link is not
comparable to a real link with an href.
Bug: 50461
Change-Id: Id8b421bd44cd5c427d0e5cd738c380bc2b1ea719
---
M modules/ve/dm/ve.dm.SurfaceFragment.js
M modules/ve/ui/actions/ve.ui.AnnotationAction.js
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/96/73896/1
diff --git a/modules/ve/dm/ve.dm.SurfaceFragment.js
b/modules/ve/dm/ve.dm.SurfaceFragment.js
index 73dd03c..88ff729 100644
--- a/modules/ve/dm/ve.dm.SurfaceFragment.js
+++ b/modules/ve/dm/ve.dm.SurfaceFragment.js
@@ -520,7 +520,7 @@
annotations = [ annotation ];
} else {
annotations =
this.document.data.getAnnotationsFromRange( this.getRange(), true )
- .getComparableAnnotations( annotation ).get();
+ .getAnnotationsByName( annotation.name ).get();
}
}
if ( this.getRange( true ).getLength() ) {
diff --git a/modules/ve/ui/actions/ve.ui.AnnotationAction.js
b/modules/ve/ui/actions/ve.ui.AnnotationAction.js
index 184de52..2b234d0 100644
--- a/modules/ve/ui/actions/ve.ui.AnnotationAction.js
+++ b/modules/ve/ui/actions/ve.ui.AnnotationAction.js
@@ -78,7 +78,7 @@
);
} else {
existingAnnotations = surfaceModel
- .getInsertionAnnotations().getComparableAnnotations(
annotation );
+ .getInsertionAnnotations().getAnnotationsByName(
annotation.name );
if ( existingAnnotations.isEmpty() ) {
surfaceModel.addInsertionAnnotations( annotation );
} else {
--
To view, visit https://gerrit.wikimedia.org/r/73896
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8b421bd44cd5c427d0e5cd738c380bc2b1ea719
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits