fixup event.preventDefault
This commit is contained in:
parent
e3df720a7f
commit
1fd70cebfc
|
@ -40,8 +40,8 @@ function createAppliesToLineWidget(cm) {
|
||||||
CLICK_ROUTE = {
|
CLICK_ROUTE = {
|
||||||
'.test-regexp': showRegExpTester,
|
'.test-regexp': showRegExpTester,
|
||||||
|
|
||||||
'.remove-applies-to': (item, apply) => {
|
'.remove-applies-to': (item, apply, event) => {
|
||||||
event.preventDefault()
|
event.preventDefault();
|
||||||
const applies = item.closest('.applies-to').__applies;
|
const applies = item.closest('.applies-to').__applies;
|
||||||
const i = applies.indexOf(apply);
|
const i = applies.indexOf(apply);
|
||||||
let repl;
|
let repl;
|
||||||
|
@ -73,8 +73,8 @@ function createAppliesToLineWidget(cm) {
|
||||||
applies.splice(i, 1);
|
applies.splice(i, 1);
|
||||||
},
|
},
|
||||||
|
|
||||||
'.add-applies-to': (item, apply) => {
|
'.add-applies-to': (item, apply, event) => {
|
||||||
event.preventDefault()
|
event.preventDefault();
|
||||||
const applies = item.closest('.applies-to').__applies;
|
const applies = item.closest('.applies-to').__applies;
|
||||||
const i = applies.indexOf(apply);
|
const i = applies.indexOf(apply);
|
||||||
const pos = apply.mark.find().to;
|
const pos = apply.mark.find().to;
|
||||||
|
@ -111,12 +111,13 @@ function createAppliesToLineWidget(cm) {
|
||||||
changeItem(item, apply, 'value', target.value);
|
changeItem(item, apply, 'value', target.value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onclick({target}) {
|
onclick(event) {
|
||||||
|
const {target} = event;
|
||||||
for (const selector in CLICK_ROUTE) {
|
for (const selector in CLICK_ROUTE) {
|
||||||
const routed = target.closest(selector);
|
const routed = target.closest(selector);
|
||||||
if (routed) {
|
if (routed) {
|
||||||
const item = routed.closest('.applies-to-item');
|
const item = routed.closest('.applies-to-item');
|
||||||
CLICK_ROUTE[selector].call(routed, item, item.__apply);
|
CLICK_ROUTE[selector].call(routed, item, item.__apply, event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user