Commit 9939c04e1808703c801327000ea8f99f33d8e936

Authored by Dmitriy Zaporozhets
2 parents 74f1da10 25d93987

Merge branch 'fix/line-numbers' into 'master'

Fix shifting line numbers.

When there are 1000 lines or more in a file, the link icon causes the numbers to shift down a line when you hover over the line number. This fixes that issue by setting a `nowrap` option for the line number anchor tag.

I also removed the fixed width of 60px for the `line-numbers` div as this causes issues for longer line numbers. I used `visibility: hidden` instead of `display: none` to ensure that the space for the link icon is taken into account. This way auto sizing the div does not cause any problems.

You can see the current behavior by looking at the following:

https://gitlab.com/gitlab-org/gitlab-ce/blob/master/vendor/assets/javascripts/ace-src-noconflict/mode-java.js
Showing 1 changed file with 4 additions and 3 deletions   Show diff stats
app/assets/stylesheets/generic/highlight.scss
... ... @@ -33,20 +33,21 @@
33 33 padding: 10px;
34 34 text-align: right;
35 35 float: left;
36   - width: 60px;
37 36  
38 37 a {
39 38 font-family: $monospace_font;
40 39 display: block;
41 40 font-size: 12px !important;
42 41 line-height: 16px !important;
  42 + white-space: nowrap;
43 43  
44 44 i {
45   - display: none;
  45 + visibility: hidden;
  46 + @extend .pull-left;
46 47 }
47 48  
48 49 &:hover i {
49   - display: inline;
  50 + visibility: visible;
50 51 }
51 52 }
52 53 }
... ...