From 1d3de17cc04e277c61eaecc5fd81880f23b3e326 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 26 2015 16:20:54 +0000 Subject: Highlight comments on pull-request page when linked to --- diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index 519ab26..56ba1c4 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -345,6 +345,28 @@ $( "#comment" ).val(_output.join("\n")); } ); + + 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); + {% endif %} });