old versions of firefox throw if negative indexes for children is used

This commit is contained in:
nightwing 2012-06-06 18:18:03 +04:00
commit 11eba737d1

View file

@ -467,14 +467,14 @@ var VirtualRenderer = function(container, theme) {
return;
if (!gutterReady) {
var ch = this.$gutterLayer.element.children
var oldEl = ch[this.$gutterLineHighlight - this.layerConfig.firstRow];
if (oldEl)
dom.removeCssClass(oldEl, "ace_gutter_active_line");
var lineEl, ch = this.$gutterLayer.element.children;
var index = this.$gutterLineHighlight - this.layerConfig.firstRow;
if (index >= 0 && (lineEl = ch[index]))
dom.removeCssClass(lineEl, "ace_gutter_active_line");
var newEl = ch[i - this.layerConfig.firstRow];
if (newEl)
dom.addCssClass(newEl, "ace_gutter_active_line");
index = i - this.layerConfig.firstRow;
if (index >= 0 && (lineEl = ch[index]))
dom.addCssClass(lineEl, "ace_gutter_active_line");
}
this.$gutterLayer.removeGutterDecoration(this.$gutterLineHighlight, "ace_gutter_active_line");