Skip to content

Commit

Permalink
clipboard: use ctrl+c to confirm copy
Browse files Browse the repository at this point in the history
This will provide easy to use flow for the user:
ctrl+c has to be clicked 3 times to copy, download and confirm

Signed-off-by: Szymon Kłos <[email protected]>
Change-Id: I745963744cdff552c37f7a5ffee5c0f737fb67ba
  • Loading branch information
eszkadev committed Oct 6, 2023
1 parent c00a9b5 commit e14897b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions browser/src/control/Control.DownloadProgress.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ L.Control.DownloadProgress = L.Control.extend({
var modalId = 'large_copy_paste_warning';

var msg = this._getLargeCopyPasteMessage();
var buttonText = _('Download') + ' (Alt + C)'; // TODO: on Mac Alt == Option
var buttonText = _('Download') + ' (Ctrl + C)'; // TODO: on Mac Ctrl == Command

if (inSnackbar) {
this._map.uiManager.showSnackbar(
Expand Down Expand Up @@ -98,7 +98,7 @@ L.Control.DownloadProgress = L.Control.extend({
_showDownloadComplete: function (inSnackbar) {
var modalId = 'copy_paste_complete';
var msg = _('Download completed and ready to be copied to clipboard.');
var buttonText = _('Copy') + ' (Alt + C)'; // TODO: on Mac Alt == Option
var buttonText = _('Copy') + ' (Ctrl + C)'; // TODO: on Mac Ctrl == Command?

if (inSnackbar) {
this._map.uiManager.showSnackbar(msg, buttonText,
Expand All @@ -115,7 +115,7 @@ L.Control.DownloadProgress = L.Control.extend({

_setupKeyboardShortcutForElement: function (eventTargetId, buttonId) {
var keyDownCallback = function(e) {
if (e.altKey && e.keyCode === 67 /*C*/) {
if (!e.altKey && !e.shiftKey && e.ctrlKey && e.key === 'c') { // CTRL + C
document.getElementById(buttonId).click();
e.preventDefault();
}
Expand Down

0 comments on commit e14897b

Please sign in to comment.