Compare commits
2 Commits
ffe1dd6f9f
...
32094f3a79
Author | SHA1 | Date | |
---|---|---|---|
|
32094f3a79 | ||
|
d46223c96a |
@ -65,7 +65,7 @@ export class Footer extends Component<{}, { synced: boolean, syncing: boolean }>
|
|||||||
Welcome <b>{Notes.name}</b>
|
Welcome <b>{Notes.name}</b>
|
||||||
</span>
|
</span>
|
||||||
<span style="color: lightgrey;">
|
<span style="color: lightgrey;">
|
||||||
v1.2
|
v1.3
|
||||||
</span>
|
</span>
|
||||||
</footer>
|
</footer>
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ export default class EntryList extends Component<{ vault: Promise<IVault> }, { n
|
|||||||
}
|
}
|
||||||
|
|
||||||
const deleteNote = async () => {
|
const deleteNote = async () => {
|
||||||
Notes.delete(note._id).then(() => {
|
this.vault.deleteNote(note._id).then(() => {
|
||||||
Notifications.sendSuccess("Deleted")
|
Notifications.sendSuccess("Deleted")
|
||||||
this.rawNotes = this.rawNotes.filter(e => e._id !== note._id);
|
this.rawNotes = this.rawNotes.filter(e => e._id !== note._id);
|
||||||
this.setState({ notes: this.state.notes.filter(e => e._id !== note._id) });
|
this.setState({ notes: this.state.notes.filter(e => e._id !== note._id) });
|
||||||
@ -93,6 +93,18 @@ export default class EntryList extends Component<{ vault: Promise<IVault> }, { n
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const copyNote = async () => {
|
||||||
|
this.vault.getNote(note._id).then(note => {
|
||||||
|
const el = document.createElement('textarea');
|
||||||
|
el.value = note.__value;
|
||||||
|
document.body.appendChild(el);
|
||||||
|
el.select();
|
||||||
|
document.execCommand('copy');
|
||||||
|
document.body.removeChild(el);
|
||||||
|
Notifications.sendSuccess("Copied");
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
let share;
|
let share;
|
||||||
if ((window.navigator as any).share) {
|
if ((window.navigator as any).share) {
|
||||||
share = <button class="uk-button" onClick={shareNote}>
|
share = <button class="uk-button" onClick={shareNote}>
|
||||||
@ -103,6 +115,7 @@ export default class EntryList extends Component<{ vault: Promise<IVault> }, { n
|
|||||||
let context = <ContextMenu event={evt} >
|
let context = <ContextMenu event={evt} >
|
||||||
{share}
|
{share}
|
||||||
<button class="uk-button" onClick={deleteNote}>delete</button>
|
<button class="uk-button" onClick={deleteNote}>delete</button>
|
||||||
|
<button class="uk-button" onClick={copyNote}>copy</button>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
|
|
||||||
this.setState({ context });
|
this.setState({ context });
|
||||||
|
Loading…
Reference in New Issue
Block a user