Conflicts:
	static/js/wide.js
This commit is contained in:
Van 2015-01-04 11:25:02 +08:00
commit 97716c8dc6
1 changed files with 9 additions and 2 deletions

View File

@ -56,8 +56,15 @@ var wide = {
$("#outline li").dblclick(function () { $("#outline li").dblclick(function () {
var $it = $(this), var $it = $(this),
cursor = CodeMirror.Pos($it.data('line'), $it.data("ch")); cursor = CodeMirror.Pos($it.data('line'), $it.data("ch"));
wide.curEditor.setCursor(cursor);
wide.curEditor.focus(); 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();
}); });
} }
}); });