create dom elements only for visible cursors

This commit is contained in:
nightwing 2012-09-06 22:34:48 +04:00
commit c54da935ab

View file

@ -148,6 +148,10 @@ var Cursor = function(parentEl) {
for (var i = selections.length; i--; ) {
sel = selections[i];
var pixelPos = this.getPixelPosition(sel.cursor, true);
if ((pixelPos.top > config.height + config.offset ||
pixelPos.top < -config.offset) && i > 1) {
continue;
}
var style = (this.cursors[cursorIndex++] || this.addCursor()).style;