Commit a8860c35 authored by Robert Knight's avatar Robert Knight

Change jQuery `.each()` callback to avoid `this`

To avoid confusion with different meanings of `this` between the
callback and surrounding scope, get the element from callback arguments
instead.
parent 048a6c7b
......@@ -325,9 +325,9 @@ export default class Guest extends Delegator {
this.selections.unsubscribe();
this.adder.remove();
this.element.find('.hypothesis-highlight').each(function () {
$(this).contents().insertBefore(this);
$(this).remove();
this.element.find('.hypothesis-highlight').each((index, element) => {
$(element).contents().insertBefore(element);
$(element).remove();
});
this.element.data('annotator', null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment