1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00

Desktop: Add button to copy note ID in Note Properties dialog (#4749)

This commit is contained in:
Abdallah Ahmed 2021-03-29 22:25:17 +02:00 committed by GitHub
parent 4810c01aec
commit c044017ba4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@ const Note = require('@joplin/lib/models/Note').default;
const formatcoords = require('formatcoords');
const bridge = require('electron').remote.require('./bridge').default;
const shim = require('@joplin/lib/shim').default;
const { clipboard } = require('electron');
class NotePropertiesDialog extends React.Component {
constructor() {
@ -318,6 +319,12 @@ class NotePropertiesDialog extends React.Component {
};
editCompIcon = 'fa-edit';
}
// Add the copy icon and the 'copy on click' event
if (key === 'id') {
editCompIcon = 'fa-copy';
editCompHandler = () => clipboard.writeText(value);
}
}
if (editCompHandler) {