From 49ca6982569723a7e95142111534c13e84bbf91a Mon Sep 17 00:00:00 2001 From: llj Date: Thu, 24 Jan 2013 14:45:32 +0800 Subject: [PATCH] [file_edit] keep the cursor visible when moving it upward --- templates/file_edit.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/file_edit.html b/templates/file_edit.html index 47eccb632d..193ff013b5 100644 --- a/templates/file_edit.html +++ b/templates/file_edit.html @@ -120,7 +120,7 @@

{% trans 'Library' %} {{repo.name}} {% trans 'is encrypted' %}


-

{% trans 'The password will be kept in the server for only 1 hour.' %}

+

{% trans "The password will be kept in the server for only 1 hour." %}

@@ -184,6 +184,10 @@ var editor = CodeMirror.fromTextArea($('#docu-view')[0], { if (cursor.yBot >= $(window).height() + $(window).scrollTop() - 60) { $(window).scrollTop($(window).scrollTop() + parseInt($('#file-edit').css('padding-bottom'))); } + // keep the cursor visible when path-op fixed and moving the cursor upward + if (cursor.y - $(window).scrollTop() < $('#path-op').outerHeight()) { + $(window).scrollTop(cursor.y - $('#path-op').outerHeight()); + } }, autofocus: true });