From 267ccf90407397f37b4d5afd8d8400f8ca35aecc Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Tue, 16 Jul 2013 00:05:11 +0100 Subject: [PATCH] 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 --- modules/ve/dm/ve.dm.SurfaceFragment.js | 2 +- modules/ve/ui/actions/ve.ui.AnnotationAction.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ve/dm/ve.dm.SurfaceFragment.js b/modules/ve/dm/ve.dm.SurfaceFragment.js index 73dd03c977..88ff7294d2 100644 --- a/modules/ve/dm/ve.dm.SurfaceFragment.js +++ b/modules/ve/dm/ve.dm.SurfaceFragment.js @@ -520,7 +520,7 @@ ve.dm.SurfaceFragment.prototype.annotateContent = function ( method, nameOrAnnot 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 184de52088..2b234d0b3f 100644 --- a/modules/ve/ui/actions/ve.ui.AnnotationAction.js +++ b/modules/ve/ui/actions/ve.ui.AnnotationAction.js @@ -78,7 +78,7 @@ ve.ui.AnnotationAction.prototype.toggle = function ( name, data ) { ); } else { existingAnnotations = surfaceModel - .getInsertionAnnotations().getComparableAnnotations( annotation ); + .getInsertionAnnotations().getAnnotationsByName( annotation.name ); if ( existingAnnotations.isEmpty() ) { surfaceModel.addInsertionAnnotations( annotation ); } else {