Permalink button drops the `#LXX` URL parameter if the "link" icon is clicked instead of the line number
### Summary
When viewing a file, clicking the "Permalink" button will cause the previously-selected line reference (e.g. `#L32`) to be dropped from the URL. This happens when the user selects a line by clicking the "link" icon instead of the actual line number.
### Steps to reproduce
1. Navigate to a file view, i.e. https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/views/shared/milestones/_sidebar.html.haml
1. Select a specific line by clicking on the link icon next to the line number. Notice that a URL parameter like `#LXX` has been appended to the current URL in your browser's address bar.
1. Click the "Permalink" button
### What is the current *bug* behavior?
The new URL no longer includes the `#LXX` parameter.
### What is the expected *correct* behavior?
The new URL should still contain the `#LXX` parameter that existed before the "Permalink" button was clicked, regardless if the line was selected by clicking the "link" icon or the actual line number.
### GIF

### Output of checks
This bug happens on GitLab.com.
issue