mattia / pagure

Forked from pagure 3 years ago
Clone

e8b316f Fix inline comment not showing on first click in PR page

1 file Authored by cep 7 years ago, Committed by pingou 7 years ago,
    Fix inline comment not showing on first click in PR page
    
    TLDR: When you click on the link to an inline comment, the URL is updated, but the
      comment was not shown.
    
    What happened:
     - Go to a random PR page.
     - Click on the line xx of path/to/file.py link on one of the inline comment cards.
     - The URL hash changes to something like #c-84ea5c920b7f17a09f095d615156b735ca1fa12c-18,
       but the actual comment is not shown.
     - Clicking on the same link again, though, shows the comment.
    
    The error was basically that the javascript checking the hash in the URL did not know
    what to do with hash like #c-<id>. This commit fixes that and thus bring back the
    expected behaviour: clicking on the link brings you to the comment in the diff.
    
    Fixes https://pagure.io/pagure/issue/1964