This commit is contained in:
parent
3bdba1a2fa
commit
1ed57dc5da
|
@ -55,9 +55,16 @@ var wide = {
|
|||
|
||||
$("#outline li").dblclick(function () {
|
||||
var $it = $(this),
|
||||
cursor = CodeMirror.Pos($it.data('line'), $it.data("ch"));
|
||||
wide.curEditor.setCursor(cursor);
|
||||
wide.curEditor.focus();
|
||||
cursor = CodeMirror.Pos($it.data('line'), $it.data("ch"));
|
||||
|
||||
var editor = wide.curEditor;
|
||||
editor.setCursor(cursor);
|
||||
|
||||
var half = Math.floor(editor.getScrollInfo().clientHeight / editor.defaultTextHeight() / 2);
|
||||
var cursorCoords = editor.cursorCoords({line: cursor.line - half, ch: 0}, "local");
|
||||
editor.scrollTo(0, cursorCoords.top);
|
||||
|
||||
editor.focus();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue