Index: trunk/extensions/VisualEditor/modules/es/models/es.DocumentModel.js |
— | — | @@ -705,8 +705,13 @@ |
706 | 706 | 'partial': [], |
707 | 707 | 'all': [] |
708 | 708 | }, |
709 | | - map = {}; |
| 709 | + map = {}, |
| 710 | + elementsCount = 0; |
710 | 711 | for ( var i = range.start; i < range.end; i++ ) { |
| 712 | + if ( es.DocumentModel.isElementData( this.data, i ) ) { |
| 713 | + elementsCount++; |
| 714 | + continue; |
| 715 | + } |
711 | 716 | for ( var j = 1; j < this.data[i].length; j++ ) { |
712 | 717 | hash = this.data[i][j].hash; |
713 | 718 | if ( hash in map ) { |
— | — | @@ -718,13 +723,14 @@ |
719 | 724 | } |
720 | 725 | var length = range.getLength(); |
721 | 726 | for ( var hash in map ) { |
722 | | - if ( map[hash][1] === length ) { |
| 727 | + if ( map[hash][1] === length - elementsCount ) { |
723 | 728 | annotations.full.push( map[hash][0] ); |
724 | 729 | } else { |
725 | 730 | annotations.partial.push( map[hash][0] ); |
726 | 731 | } |
727 | 732 | annotations.all.push( map[hash][0] ); |
728 | 733 | } |
| 734 | + console.log(annotations); |
729 | 735 | return annotations; |
730 | 736 | }; |
731 | 737 | |