]> source.dussan.org Git - redmine.git/commitdiff
fix back-button on description diff page in case of no browser history (#13697)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 21 May 2013 07:11:25 +0000 (07:11 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 21 May 2013 07:11:25 +0000 (07:11 +0000)
Contributed by Filou Centrinov.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11893 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/journals/diff.html.erb

index 21b8755e76caa5a1b1cc8dd6182349a8016bce97..4d425f378add0ca78f53e8b24aac0ffa9f836c1e 100644 (file)
@@ -5,6 +5,9 @@
 <%= simple_format_without_paragraph @diff.to_html %>
 </div>
 
-<p><%= link_to l(:button_back), issue_path(@issue), :onclick => 'history.back(); return false;' %></p>
+<p>
+  <%= link_to(l(:button_back), issue_path(@issue),
+              :onclick => 'if (history.length > 1) {history.back(); return false;}') %>
+</p>
 
 <% html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>