Skip to content

Instantly share code, notes, and snippets.

@jamiefolsom
Created November 15, 2012 16:56
Show Gist options
  • Save jamiefolsom/4079751 to your computer and use it in GitHub Desktop.
Save jamiefolsom/4079751 to your computer and use it in GitHub Desktop.
Annotator Exception
n.prototype.setupAnnotation = function(t, n) {
var r, s, o, u, a, f, l, c, h;
n == null && (n = !0), u = this.wrapper[0], t.ranges || (t.ranges = this.selectedRanges), s = [], h = t.ranges;
for (a = 0, l = h.length; a < l; a++) {
o = h[a];
try {
s.push(i.sniff(o).normalize(u))
} catch (p) {
if (!(p instanceof i.RangeError))
throw p;
// exception:
Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1
this.publish("rangeNormalizeFail", [t, o, p])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment