Fix: e.target -> this
This commit is contained in:
parent
809414941e
commit
3d57fd4158
|
@ -253,7 +253,7 @@ function createAppliesToLineWidget(cm) {
|
||||||
type: 'button',
|
type: 'button',
|
||||||
className: 'applies-to-remove',
|
className: 'applies-to-remove',
|
||||||
textContent: t('appliesRemove'),
|
textContent: t('appliesRemove'),
|
||||||
onclick(e) {
|
onclick() {
|
||||||
const i = applies.indexOf(apply);
|
const i = applies.indexOf(apply);
|
||||||
let repl;
|
let repl;
|
||||||
let from;
|
let from;
|
||||||
|
@ -281,7 +281,7 @@ function createAppliesToLineWidget(cm) {
|
||||||
}
|
}
|
||||||
cm.replaceRange(repl, from, to, 'appliesTo');
|
cm.replaceRange(repl, from, to, 'appliesTo');
|
||||||
clearApply(apply);
|
clearApply(apply);
|
||||||
e.target.closest('li').remove();
|
this.closest('li').remove();
|
||||||
applies.splice(i, 1);
|
applies.splice(i, 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -290,7 +290,7 @@ function createAppliesToLineWidget(cm) {
|
||||||
type: 'button',
|
type: 'button',
|
||||||
className: 'applies-to-add',
|
className: 'applies-to-add',
|
||||||
textContent: t('appliesAdd'),
|
textContent: t('appliesAdd'),
|
||||||
onclick(e) {
|
onclick() {
|
||||||
const i = applies.indexOf(apply);
|
const i = applies.indexOf(apply);
|
||||||
const pos = apply.mark.find().to;
|
const pos = apply.mark.find().to;
|
||||||
const text = `, ${apply.type.text}("")`;
|
const text = `, ${apply.type.text}("")`;
|
||||||
|
@ -303,7 +303,7 @@ function createAppliesToLineWidget(cm) {
|
||||||
);
|
);
|
||||||
setupApplyMarkers(newApply);
|
setupApplyMarkers(newApply);
|
||||||
applies.splice(i + 1, 0, newApply);
|
applies.splice(i + 1, 0, newApply);
|
||||||
const li = e.target.closest('li');
|
const li = this.closest('li');
|
||||||
li.parentNode.insertBefore(makeLi(newApply), li.nextSibling);
|
li.parentNode.insertBefore(makeLi(newApply), li.nextSibling);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user