aboutsummaryrefslogtreecommitdiff
path: root/public/js/gogs.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js/gogs.js')
-rw-r--r--public/js/gogs.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/public/js/gogs.js b/public/js/gogs.js
index b7770fde..2cd98d3b 100644
--- a/public/js/gogs.js
+++ b/public/js/gogs.js
@@ -542,6 +542,20 @@ function initRepository() {
$item.find(".bar .add").css("width", addPercent + "%");
});
}
+
+ $('.diff-file-box .lines-num').click(function () {
+ if ($(this).attr('id')) {
+ window.location.href = '#' + $(this).attr('id');
+ }
+ });
+
+ $(window).on('hashchange', function (e) {
+ $('.diff-file-box .lines-code.active').removeClass('active');
+ var m = window.location.hash.match(/^#diff-.+$/);
+ if (m) {
+ $(m[0]).siblings('.lines-code').addClass('active');
+ }
+ }).trigger('hashchange');
}
// Quick start and repository home