mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-17 16:45:21 +00:00
在title input中tab, 切换可写, focus content
This commit is contained in:
@@ -1158,7 +1158,7 @@ Note.newNote = function(notebookId, isShare, fromUserId, isMarkdown) {
|
||||
Notebook.incrNotebookNumberNotes(notebookId);
|
||||
|
||||
// 切换到写模式
|
||||
Note.toggleWriteable();
|
||||
Note.toggleWriteable(true);
|
||||
};
|
||||
|
||||
// 同步
|
||||
@@ -1794,7 +1794,7 @@ Note.toggleReadOnly = function(needSave) {
|
||||
};
|
||||
|
||||
// 切换到编辑模式
|
||||
LEA.toggleWriteable = Note.toggleWriteable = function() {
|
||||
LEA.toggleWriteable = Note.toggleWriteable = function(isFromNewNote) {
|
||||
var me = Note;
|
||||
|
||||
// $('#infoToolbar').hide();
|
||||
@@ -1818,9 +1818,12 @@ LEA.toggleWriteable = Note.toggleWriteable = function() {
|
||||
$('#editorContent pre').each(function() {
|
||||
LeaAce.setAceReadOnly($(this), false);
|
||||
});
|
||||
|
||||
isFromNewNote || tinymce.activeEditor.focus();
|
||||
}
|
||||
else {
|
||||
if(MD) {
|
||||
isFromNewNote || MD.focus();
|
||||
MD.onResize();
|
||||
}
|
||||
}
|
||||
@@ -3267,6 +3270,17 @@ $(function() {
|
||||
Note.toggleWriteableAndReadOnly();
|
||||
});
|
||||
|
||||
// note title 里按tab, 切换到编辑区
|
||||
$('#noteTitle').on("keydown", function(e) {
|
||||
var keyCode = e.keyCode || e.witch;
|
||||
// tab
|
||||
if (keyCode == 9) {
|
||||
// 一举两得, 即切换到了writable, 又focus了
|
||||
Note.toggleWriteable();
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// 定时器启动
|
||||
|
Reference in New Issue
Block a user