- Fix: Only clear selection by escape key if not within a dialog (as the escape key should only close the dialog)
- Fix: Ensure escape key will work from within input text boxes (as was already added for textareas) - Refactoring: Share code for dialog selectors
This commit is contained in:
20
dist/index-es.js
vendored
20
dist/index-es.js
vendored
@@ -21284,7 +21284,7 @@ function jqPluginJSHotkeys (b) {
|
||||
e = d.data.toLowerCase().split(" ");
|
||||
|
||||
d.handler = function (n) {
|
||||
if (this !== n.target && (n.which !== 27 && /textarea|select/i.test(n.target.nodeName) || n.target.type === "text")) {
|
||||
if (this !== n.target && n.which !== 27 && (/textarea|select/i.test(n.target.nodeName) || n.target.type === "text")) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -33015,6 +33015,7 @@ editor.init = function () {
|
||||
}); // Prevent browser from erroneously repopulating fields
|
||||
|
||||
$$b('input,select').attr('autocomplete', 'off');
|
||||
var dialogSelectors = ['#tool_source_cancel', '#tool_docprops_cancel', '#tool_prefs_cancel', '.overlay'];
|
||||
/**
|
||||
* Associate all button actions as well as non-button keyboard shortcuts
|
||||
* @namespace {PlainObject} module:SVGEditor~Actions
|
||||
@@ -33152,7 +33153,17 @@ editor.init = function () {
|
||||
evt: 'click',
|
||||
key: ['F', true]
|
||||
}, {
|
||||
sel: '#tool_source_cancel,.overlay,#tool_docprops_cancel,#tool_prefs_cancel',
|
||||
key: ['esc', false, false],
|
||||
fn: function fn() {
|
||||
if (dialogSelectors.every(function (sel) {
|
||||
return $$b(sel + ':hidden').length;
|
||||
})) {
|
||||
svgCanvas.clearSelection();
|
||||
}
|
||||
},
|
||||
hidekey: true
|
||||
}, {
|
||||
sel: dialogSelectors.join(','),
|
||||
fn: cancelOverlays,
|
||||
evt: 'click',
|
||||
key: ['esc', false, false],
|
||||
@@ -33413,11 +33424,6 @@ editor.init = function () {
|
||||
fn: function fn() {
|
||||
svgCanvas.selectAllInCurrentLayer();
|
||||
}
|
||||
}, {
|
||||
key: ['esc', false, false],
|
||||
fn: function fn() {
|
||||
svgCanvas.clearSelection();
|
||||
}
|
||||
}, // Standard shortcuts
|
||||
{
|
||||
key: modKey + 'z',
|
||||
|
||||
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
20
dist/index-umd.js
vendored
20
dist/index-umd.js
vendored
@@ -21290,7 +21290,7 @@
|
||||
e = d.data.toLowerCase().split(" ");
|
||||
|
||||
d.handler = function (n) {
|
||||
if (this !== n.target && (n.which !== 27 && /textarea|select/i.test(n.target.nodeName) || n.target.type === "text")) {
|
||||
if (this !== n.target && n.which !== 27 && (/textarea|select/i.test(n.target.nodeName) || n.target.type === "text")) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -33021,6 +33021,7 @@
|
||||
}); // Prevent browser from erroneously repopulating fields
|
||||
|
||||
$$b('input,select').attr('autocomplete', 'off');
|
||||
var dialogSelectors = ['#tool_source_cancel', '#tool_docprops_cancel', '#tool_prefs_cancel', '.overlay'];
|
||||
/**
|
||||
* Associate all button actions as well as non-button keyboard shortcuts
|
||||
* @namespace {PlainObject} module:SVGEditor~Actions
|
||||
@@ -33158,7 +33159,17 @@
|
||||
evt: 'click',
|
||||
key: ['F', true]
|
||||
}, {
|
||||
sel: '#tool_source_cancel,.overlay,#tool_docprops_cancel,#tool_prefs_cancel',
|
||||
key: ['esc', false, false],
|
||||
fn: function fn() {
|
||||
if (dialogSelectors.every(function (sel) {
|
||||
return $$b(sel + ':hidden').length;
|
||||
})) {
|
||||
svgCanvas.clearSelection();
|
||||
}
|
||||
},
|
||||
hidekey: true
|
||||
}, {
|
||||
sel: dialogSelectors.join(','),
|
||||
fn: cancelOverlays,
|
||||
evt: 'click',
|
||||
key: ['esc', false, false],
|
||||
@@ -33419,11 +33430,6 @@
|
||||
fn: function fn() {
|
||||
svgCanvas.selectAllInCurrentLayer();
|
||||
}
|
||||
}, {
|
||||
key: ['esc', false, false],
|
||||
fn: function fn() {
|
||||
svgCanvas.clearSelection();
|
||||
}
|
||||
}, // Standard shortcuts
|
||||
{
|
||||
key: modKey + 'z',
|
||||
|
||||
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
Reference in New Issue
Block a user