Merge "Fix annotation object creation in SurfaceFragment"

This commit is contained in:
Catrope 2012-10-26 17:53:10 +00:00 committed by Gerrit Code Review
commit bc8b042e5f
2 changed files with 4 additions and 1 deletions

View file

@ -19,6 +19,8 @@
* this.data by overriding getAnnotationData(). Subclasses can read from this.data but must not
* write to it directly.
*
* TODO: Make this constructor optionally accept a data object instead of an element.
*
* @class
* @abstract
* @constructor

View file

@ -358,7 +358,8 @@ ve.dm.SurfaceFragment.prototype.annotateContent = function ( method, type, data
return this;
}
var tx,
annotation = { 'type': type };
annotation = ve.dm.annotationFactory.create( type );
// HACK: This seems wrong, the way we create annotations should be refactored
if ( data ) {
annotation.data = data;
}