From f23c9eb17709086671986c8aea73b6477b482bbc Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 8 Jul 2017 14:56:19 +0000 Subject: [PATCH] Note URLs should highlight the linked note (#22978). Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@16776 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/issues/show.html.erb | 11 +++++++++++ public/stylesheets/application.css | 1 + 2 files changed, 12 insertions(+) diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 3da22d4af..46494ff9f 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -167,3 +167,14 @@ end %> <% end %> <%= context_menu %> + +<%= javascript_tag do %> +$(document).ready(function(){ + $(window).on('load hashchange',function(){ + var hash = location.hash; + if (hash.match(/^#(change|note)-\d+$/)){ + $('div' + hash).addClass('highlight').removeClass('highlight', 2000) + } + }); +}); +<% end %> diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 519773bb2..9dce0dca4 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -760,6 +760,7 @@ div.thumbnails {margin:0.6em;} div.thumbnails div {background:#fff;border:2px solid #ddd;display:inline-block;margin-right:2px;} div.thumbnails img {margin: 3px; vertical-align: middle;} #history div.thumbnails {margin-left: 2em;} +#history div.highlight {background-color: #ffffdd;} p.other-formats { text-align: right; font-size:0.9em; color: #666; } .other-formats span + span:before { content: "| "; }