do not group annotations by rows since whole array is replaced every time

This commit is contained in:
nightwing 2012-09-06 18:55:11 +04:00
commit 82550104db
2 changed files with 20 additions and 31 deletions

View file

@ -752,15 +752,7 @@ var EditSession = function(text, mode) {
* Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event.
**/
this.setAnnotations = function(annotations) {
this.$annotations = {};
for (var i=0; i<annotations.length; i++) {
var annotation = annotations[i];
var row = annotation.row;
if (this.$annotations[row])
this.$annotations[row].push(annotation);
else
this.$annotations[row] = [annotation];
}
this.$annotations = annotations;
this._emit("changeAnnotation", {});
};