From 4613707909a73a2fbf27614cf8b00b92e5057ec9 Mon Sep 17 00:00:00 2001 From: Rob Moen Date: Mon, 24 Sep 2012 17:14:22 -0700 Subject: [PATCH] re: AnnotationSet, fix JS error in getFirstLinkAnnotation. Change-Id: I6a3cb4eb2164bf1c4c8f715e42117ac06cccac04 --- modules/ve/ui/inspectors/ve.ui.LinkInspector.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/ve/ui/inspectors/ve.ui.LinkInspector.js b/modules/ve/ui/inspectors/ve.ui.LinkInspector.js index 6ddbbdf230..f7f3b703d1 100644 --- a/modules/ve/ui/inspectors/ve.ui.LinkInspector.js +++ b/modules/ve/ui/inspectors/ve.ui.LinkInspector.js @@ -94,17 +94,16 @@ ve.ui.LinkInspector.prototype.getAllLinkAnnotationsFromSelection = function () { }; ve.ui.LinkInspector.prototype.getFirstLinkAnnotation = function ( annotations ) { - var i, annotation, arr = annotations.get(); - for ( i = 0; i < arr.length; i++ ) { + var i; + for ( i = 0; i < annotations.length; i++ ) { // Use the first one with a recognized type (there should only be one, this is just in case) - annotation = arr[i]; if ( - annotation.type === 'link/WikiLink' || - annotation.type === 'link/ExtLink' || - annotation.type === 'link/ExtLink/Numbered' || - annotation.type === 'link/ExtLink/URL' + annotations[i].type === 'link/WikiLink' || + annotations[i].type === 'link/ExtLink' || + annotations[i].type === 'link/ExtLink/Numbered' || + annotations[i].type === 'link/ExtLink/URL' ) { - return annotation; + return annotations[i]; } } return null;