diff --git a/public/css/gogs.css b/public/css/gogs.css index 5ce0588ff..296b17808 100644 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -1480,12 +1480,11 @@ footer .ui.language .menu { .repository.file.list #file-content .code-view table { width: 100%; } -.repository.file.list #file-content .code-view td{ +.repository.file.list #file-content .code-view td { border: none; } .repository.file.list #file-content .code-view .blob-num { width: 1%; - min-width: 50px; line-height: 20px; cursor: pointer; text-align: right; @@ -1505,15 +1504,14 @@ footer .ui.language .menu { } .repository.file.list #file-content .code-view .blob-code pre, .repository.file.list #file-content .code-view .blob-code .hljs { - background-color: white; margin: 0; padding: 0 !important; } - -.repository.file.list #file-content .code-view .blob-code pre li.active, -.repository.file.list #file-content .code-view .blob-code ol li.active, -.repository.file.list #file-content .code-view .blob-code .hljs li.active { - background: #ffffdd; +.repository.file.list #file-content .code-view .blob-code { + background-color: white; +} +.repository.file.list #file-content .code-view .blob-code.active { + background: #ffffdd !important;; } .repository.file.list .sidebar { diff --git a/public/js/gogs.js b/public/js/gogs.js index 4eefff5ce..803375694 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -1048,11 +1048,11 @@ function searchRepositories() { function initCodeView() { if ($('.code-view .linenums').length > 0) { - $(document).on('click', '.lines-num span', function (e) { + $(document).on('click', '.blob-num', function (e) { var $select = $(this); - var $list = $select.parent().siblings('.lines-code').find('ol.linenums > li'); - selectRange($list, $list.filter('[rel=' + $select.attr('id') + ']'), (e.shiftKey ? $list.filter('.active').eq(0) : null)); - deSelect(); + var $code = $select.parent().find('.blob-code'); + $select.parent().parent().find(".blob-code").removeClass("active"); + $code.addClass("active"); }); $(window).on('hashchange', function (e) { diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index 2abcc7107..f4d661570 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -35,7 +35,7 @@ {{end}} -
+
{{if .IsMarkdown}} {{if .FileContent}}{{.FileContent | Str2html}}{{end}}