From 23b6e1976b82691cc62a4e150b22454397f4b46d Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 18 2015 16:27:18 +0000 Subject: Highlight the selected comment --- diff --git a/progit/templates/issue.html b/progit/templates/issue.html index 658c89d..9ade753 100644 --- a/progit/templates/issue.html +++ b/progit/templates/issue.html @@ -244,6 +244,27 @@ $(function() { delay: 200, }); + var cur_hash = null; + + highlight_comment = function() { + var _hash = window.location.hash; + if (_hash != cur_hash) { + $( cur_hash ).css( + "background", "linear-gradient(to bottom, #ededed 0%, #fff 100%)" + ); + }; + cur_hash = _hash; + if ( _hash ) { + $( _hash ).css( + "background", "linear-gradient(to bottom, #eded98 0%, #fff 100%)" + ); + }; + return false; + }; + + $(window.onload=highlight_comment()); + $(window).on('hashchange', highlight_comment); + }); {% endblock %}