mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-17 16:45:21 +00:00
ctrl+a, context menu定位, markdown一旦setContent就focus, 导致搜索失去焦点
This commit is contained in:
@@ -1136,11 +1136,16 @@ Note.saveNote = function(e) {
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
// copy, paste
|
||||||
if(e.ctrlKey || e.metaKey) {
|
if(e.ctrlKey || e.metaKey) {
|
||||||
if(num == 67) { // ctrl + c
|
if(num == 67) { // ctrl + c
|
||||||
document.execCommand('copy');
|
document.execCommand('copy');
|
||||||
} else if(num == 86) { // ctrl + v
|
} else if(num == 86) { // ctrl + v
|
||||||
document.execCommand('paste');
|
document.execCommand('paste');
|
||||||
|
} else if(num == 65) { // ctrl + a
|
||||||
|
document.execCommand('selectAll');
|
||||||
|
} else if(num == 88) { // ctrl + x
|
||||||
|
document.execCommand('cut');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1436,7 +1441,6 @@ Note.searchNote = function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 之前有, 还有结束的
|
// 之前有, 还有结束的
|
||||||
// if(Note.lastSearch) {
|
// if(Note.lastSearch) {
|
||||||
// Note.lastSearch.abort();
|
// Note.lastSearch.abort();
|
||||||
@@ -1460,6 +1464,10 @@ Note.searchNote = function() {
|
|||||||
if(t == Note.searchSeq && notes) {
|
if(t == Note.searchSeq && notes) {
|
||||||
Notebook.changeCurNotebookTitle('Search results', false, notes.length);
|
Notebook.changeCurNotebookTitle('Search results', false, notes.length);
|
||||||
Note.renderNotes(notes);
|
Note.renderNotes(notes);
|
||||||
|
// markdown一旦setContent就focus, 导致搜索失去焦点
|
||||||
|
setTimeout(function() {
|
||||||
|
$("#searchNoteInput").focus();
|
||||||
|
})
|
||||||
if(!isEmpty(notes)) {
|
if(!isEmpty(notes)) {
|
||||||
Note.changeNote(notes[0].NoteId, false/*, true || Note.isOver2Seconds*/); // isShare, needSaveChanged?, 超过2秒就要保存
|
Note.changeNote(notes[0].NoteId, false/*, true || Note.isOver2Seconds*/); // isShare, needSaveChanged?, 超过2秒就要保存
|
||||||
}
|
}
|
||||||
|
@@ -88,6 +88,7 @@ this.copy = new gui.MenuItem({
|
|||||||
this.paste = new gui.MenuItem({
|
this.paste = new gui.MenuItem({
|
||||||
label: '粘贴',
|
label: '粘贴',
|
||||||
click: function () {
|
click: function () {
|
||||||
|
// document.execCommand("selectAll");
|
||||||
document.execCommand('paste');
|
document.execCommand('paste');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user