- Fix: Map extension click events to "mousedown" so they can be received
on touch devices (since `touch.js` changes `touchstart` to
`mousedown`) (@ClemArt); closes #168
- Fix: Ensure extension `mouseup` events run on "zoom" and "select"
modes (@iuyiuy); closes #159
This commit is contained in:
@@ -1,5 +1,10 @@
|
|||||||
# ?
|
# ?
|
||||||
|
|
||||||
|
- Fix: Map extension click events to "mousedown" so they can be received
|
||||||
|
on touch devices (since `touch.js` changes `touchstart` to
|
||||||
|
`mousedown`) (@ClemArt); closes #168
|
||||||
|
- Fix: Ensure extension `mouseup` events run on "zoom" and "select"
|
||||||
|
modes (@iuyiuy); closes #159
|
||||||
- Enhancement: Allow "Escape" to work with hotkeys within text boxes;
|
- Enhancement: Allow "Escape" to work with hotkeys within text boxes;
|
||||||
allows escaping out of source textarea (part of #291)
|
allows escaping out of source textarea (part of #291)
|
||||||
- Enhancement: Allow 'a' also with meta key (command in Mac, ctrl otherwise)
|
- Enhancement: Allow 'a' also with meta key (command in Mac, ctrl otherwise)
|
||||||
|
|||||||
12
dist/index-es.js
vendored
12
dist/index-es.js
vendored
@@ -16059,7 +16059,7 @@ function SvgCanvas(container, config) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
break;
|
||||||
|
|
||||||
case 'zoom':
|
case 'zoom':
|
||||||
if (rubberBox != null) {
|
if (rubberBox != null) {
|
||||||
@@ -16074,7 +16074,7 @@ function SvgCanvas(container, config) {
|
|||||||
height: Math.abs(realY - rStartY),
|
height: Math.abs(realY - rStartY),
|
||||||
factor: factor
|
factor: factor
|
||||||
});
|
});
|
||||||
return;
|
break;
|
||||||
|
|
||||||
case 'fhpath':
|
case 'fhpath':
|
||||||
// Check that the path contains at least 2 points; a degenerate one-point path
|
// Check that the path contains at least 2 points; a degenerate one-point path
|
||||||
@@ -31090,6 +31090,12 @@ editor.init = function () {
|
|||||||
// Add given events to button
|
// Add given events to button
|
||||||
$$b.each(btn.events, function (name, func) {
|
$$b.each(btn.events, function (name, func) {
|
||||||
if (name === 'click' && btn.type === 'mode') {
|
if (name === 'click' && btn.type === 'mode') {
|
||||||
|
// `touch.js` changes `touchstart` to `mousedown`,
|
||||||
|
// so we must map extension click events as well
|
||||||
|
if (isTouch() && name === 'click') {
|
||||||
|
name = 'mousedown';
|
||||||
|
}
|
||||||
|
|
||||||
if (btn.includeWith) {
|
if (btn.includeWith) {
|
||||||
button.bind(name, func);
|
button.bind(name, func);
|
||||||
} else {
|
} else {
|
||||||
@@ -33470,6 +33476,8 @@ editor.init = function () {
|
|||||||
|
|
||||||
|
|
||||||
if (opts.evt) {
|
if (opts.evt) {
|
||||||
|
// `touch.js` changes `touchstart` to `mousedown`,
|
||||||
|
// so we must map tool button click events as well
|
||||||
if (isTouch() && opts.evt === 'click') {
|
if (isTouch() && opts.evt === 'click') {
|
||||||
opts.evt = 'mousedown';
|
opts.evt = 'mousedown';
|
||||||
}
|
}
|
||||||
|
|||||||
2
dist/index-es.min.js
vendored
2
dist/index-es.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index-es.min.js.map
vendored
2
dist/index-es.min.js.map
vendored
File diff suppressed because one or more lines are too long
12
dist/index-umd.js
vendored
12
dist/index-umd.js
vendored
@@ -16065,7 +16065,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
break;
|
||||||
|
|
||||||
case 'zoom':
|
case 'zoom':
|
||||||
if (rubberBox != null) {
|
if (rubberBox != null) {
|
||||||
@@ -16080,7 +16080,7 @@
|
|||||||
height: Math.abs(realY - rStartY),
|
height: Math.abs(realY - rStartY),
|
||||||
factor: factor
|
factor: factor
|
||||||
});
|
});
|
||||||
return;
|
break;
|
||||||
|
|
||||||
case 'fhpath':
|
case 'fhpath':
|
||||||
// Check that the path contains at least 2 points; a degenerate one-point path
|
// Check that the path contains at least 2 points; a degenerate one-point path
|
||||||
@@ -31096,6 +31096,12 @@
|
|||||||
// Add given events to button
|
// Add given events to button
|
||||||
$$b.each(btn.events, function (name, func) {
|
$$b.each(btn.events, function (name, func) {
|
||||||
if (name === 'click' && btn.type === 'mode') {
|
if (name === 'click' && btn.type === 'mode') {
|
||||||
|
// `touch.js` changes `touchstart` to `mousedown`,
|
||||||
|
// so we must map extension click events as well
|
||||||
|
if (isTouch() && name === 'click') {
|
||||||
|
name = 'mousedown';
|
||||||
|
}
|
||||||
|
|
||||||
if (btn.includeWith) {
|
if (btn.includeWith) {
|
||||||
button.bind(name, func);
|
button.bind(name, func);
|
||||||
} else {
|
} else {
|
||||||
@@ -33476,6 +33482,8 @@
|
|||||||
|
|
||||||
|
|
||||||
if (opts.evt) {
|
if (opts.evt) {
|
||||||
|
// `touch.js` changes `touchstart` to `mousedown`,
|
||||||
|
// so we must map tool button click events as well
|
||||||
if (isTouch() && opts.evt === 'click') {
|
if (isTouch() && opts.evt === 'click') {
|
||||||
opts.evt = 'mousedown';
|
opts.evt = 'mousedown';
|
||||||
}
|
}
|
||||||
|
|||||||
2
dist/index-umd.min.js
vendored
2
dist/index-umd.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index-umd.min.js.map
vendored
2
dist/index-umd.min.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -3301,6 +3301,11 @@ editor.init = function () {
|
|||||||
// Add given events to button
|
// Add given events to button
|
||||||
$.each(btn.events, function (name, func) {
|
$.each(btn.events, function (name, func) {
|
||||||
if (name === 'click' && btn.type === 'mode') {
|
if (name === 'click' && btn.type === 'mode') {
|
||||||
|
// `touch.js` changes `touchstart` to `mousedown`,
|
||||||
|
// so we must map extension click events as well
|
||||||
|
if (isTouch() && name === 'click') {
|
||||||
|
name = 'mousedown';
|
||||||
|
}
|
||||||
if (btn.includeWith) {
|
if (btn.includeWith) {
|
||||||
button.bind(name, func);
|
button.bind(name, func);
|
||||||
} else {
|
} else {
|
||||||
@@ -5248,6 +5253,8 @@ editor.init = function () {
|
|||||||
btn = $(opts.sel);
|
btn = $(opts.sel);
|
||||||
if (!btn.length) { return true; } // Skip if markup does not exist
|
if (!btn.length) { return true; } // Skip if markup does not exist
|
||||||
if (opts.evt) {
|
if (opts.evt) {
|
||||||
|
// `touch.js` changes `touchstart` to `mousedown`,
|
||||||
|
// so we must map tool button click events as well
|
||||||
if (isTouch() && opts.evt === 'click') {
|
if (isTouch() && opts.evt === 'click') {
|
||||||
opts.evt = 'mousedown';
|
opts.evt = 'mousedown';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2615,7 +2615,7 @@ const mouseUp = function (evt) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
break;
|
||||||
case 'zoom':
|
case 'zoom':
|
||||||
if (rubberBox != null) {
|
if (rubberBox != null) {
|
||||||
rubberBox.setAttribute('display', 'none');
|
rubberBox.setAttribute('display', 'none');
|
||||||
@@ -2628,7 +2628,7 @@ const mouseUp = function (evt) {
|
|||||||
height: Math.abs(realY - rStartY),
|
height: Math.abs(realY - rStartY),
|
||||||
factor
|
factor
|
||||||
});
|
});
|
||||||
return;
|
break;
|
||||||
case 'fhpath':
|
case 'fhpath':
|
||||||
// Check that the path contains at least 2 points; a degenerate one-point path
|
// Check that the path contains at least 2 points; a degenerate one-point path
|
||||||
// causes problems.
|
// causes problems.
|
||||||
|
|||||||
@@ -16062,7 +16062,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
break;
|
||||||
|
|
||||||
case 'zoom':
|
case 'zoom':
|
||||||
if (rubberBox != null) {
|
if (rubberBox != null) {
|
||||||
@@ -16077,7 +16077,7 @@
|
|||||||
height: Math.abs(realY - rStartY),
|
height: Math.abs(realY - rStartY),
|
||||||
factor: factor
|
factor: factor
|
||||||
});
|
});
|
||||||
return;
|
break;
|
||||||
|
|
||||||
case 'fhpath':
|
case 'fhpath':
|
||||||
// Check that the path contains at least 2 points; a degenerate one-point path
|
// Check that the path contains at least 2 points; a degenerate one-point path
|
||||||
@@ -31093,6 +31093,12 @@
|
|||||||
// Add given events to button
|
// Add given events to button
|
||||||
$$b.each(btn.events, function (name, func) {
|
$$b.each(btn.events, function (name, func) {
|
||||||
if (name === 'click' && btn.type === 'mode') {
|
if (name === 'click' && btn.type === 'mode') {
|
||||||
|
// `touch.js` changes `touchstart` to `mousedown`,
|
||||||
|
// so we must map extension click events as well
|
||||||
|
if (isTouch() && name === 'click') {
|
||||||
|
name = 'mousedown';
|
||||||
|
}
|
||||||
|
|
||||||
if (btn.includeWith) {
|
if (btn.includeWith) {
|
||||||
button.bind(name, func);
|
button.bind(name, func);
|
||||||
} else {
|
} else {
|
||||||
@@ -33473,6 +33479,8 @@
|
|||||||
|
|
||||||
|
|
||||||
if (opts.evt) {
|
if (opts.evt) {
|
||||||
|
// `touch.js` changes `touchstart` to `mousedown`,
|
||||||
|
// so we must map tool button click events as well
|
||||||
if (isTouch() && opts.evt === 'click') {
|
if (isTouch() && opts.evt === 'click') {
|
||||||
opts.evt = 'mousedown';
|
opts.evt = 'mousedown';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16062,7 +16062,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
break;
|
||||||
|
|
||||||
case 'zoom':
|
case 'zoom':
|
||||||
if (rubberBox != null) {
|
if (rubberBox != null) {
|
||||||
@@ -16077,7 +16077,7 @@
|
|||||||
height: Math.abs(realY - rStartY),
|
height: Math.abs(realY - rStartY),
|
||||||
factor: factor
|
factor: factor
|
||||||
});
|
});
|
||||||
return;
|
break;
|
||||||
|
|
||||||
case 'fhpath':
|
case 'fhpath':
|
||||||
// Check that the path contains at least 2 points; a degenerate one-point path
|
// Check that the path contains at least 2 points; a degenerate one-point path
|
||||||
@@ -31093,6 +31093,12 @@
|
|||||||
// Add given events to button
|
// Add given events to button
|
||||||
$$b.each(btn.events, function (name, func) {
|
$$b.each(btn.events, function (name, func) {
|
||||||
if (name === 'click' && btn.type === 'mode') {
|
if (name === 'click' && btn.type === 'mode') {
|
||||||
|
// `touch.js` changes `touchstart` to `mousedown`,
|
||||||
|
// so we must map extension click events as well
|
||||||
|
if (isTouch() && name === 'click') {
|
||||||
|
name = 'mousedown';
|
||||||
|
}
|
||||||
|
|
||||||
if (btn.includeWith) {
|
if (btn.includeWith) {
|
||||||
button.bind(name, func);
|
button.bind(name, func);
|
||||||
} else {
|
} else {
|
||||||
@@ -33473,6 +33479,8 @@
|
|||||||
|
|
||||||
|
|
||||||
if (opts.evt) {
|
if (opts.evt) {
|
||||||
|
// `touch.js` changes `touchstart` to `mousedown`,
|
||||||
|
// so we must map tool button click events as well
|
||||||
if (isTouch() && opts.evt === 'click') {
|
if (isTouch() && opts.evt === 'click') {
|
||||||
opts.evt = 'mousedown';
|
opts.evt = 'mousedown';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user