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 { ...@@ -325,9 +325,9 @@ export default class Guest extends Delegator {
this.selections.unsubscribe(); this.selections.unsubscribe();
this.adder.remove(); this.adder.remove();
this.element.find('.hypothesis-highlight').each(function () { this.element.find('.hypothesis-highlight').each((index, element) => {
$(this).contents().insertBefore(this); $(element).contents().insertBefore(element);
$(this).remove(); $(element).remove();
}); });
this.element.data('annotator', null); 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