Diff/Patch: Split view - enable line hover (#5039)

* patch page: enable line hover

* improve CSS + enable for unified

* add more CSS classes to table rows
This commit is contained in:
Christian Günter 2021-10-18 21:00:25 +02:00 committed by GitHub
parent 7c977f4c4d
commit bf5634d243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -501,6 +501,11 @@ table.diff_tab td.patch, th.patch {
user-select: none;
cursor: pointer;
}
table.diff_tab tr.diff_line:hover td {
background-image: linear-gradient(rgba(0, 0, 0, 0.075), rgba(0, 0, 0, 0.075));
}
table.diff_tab td.num::before {
content: attr(line-num);
}

View File

@ -1006,7 +1006,7 @@ CLASS zcl_abapgit_gui_page_diff IMPLEMENTATION.
&& |<td class="code{ lv_bg } diff_right">{ is_diff_line-old }</td>|.
" render line, inverse sides if remote is newer
ri_html->add( '<tr>' ).
ri_html->add( '<tr class="diff_line">' ).
render_line_split_row(
ii_html = ri_html
@ -1044,7 +1044,7 @@ CLASS zcl_abapgit_gui_page_diff IMPLEMENTATION.
" Release delayed subsequent update lines
IF is_diff_line-result <> zif_abapgit_definitions=>c_diff-update.
LOOP AT mt_delayed_lines ASSIGNING <ls_diff_line>.
ri_html->add( '<tr>' ).
ri_html->add( '<tr class="diff_line">' ).
ri_html->add( |<td class="num diff_others" line-num="{ <ls_diff_line>-old_num }"></td>|
&& |<td class="num diff_others" line-num=""></td>|
&& |<td class="mark diff_others">-</td>|
@ -1052,7 +1052,7 @@ CLASS zcl_abapgit_gui_page_diff IMPLEMENTATION.
ri_html->add( '</tr>' ).
ENDLOOP.
LOOP AT mt_delayed_lines ASSIGNING <ls_diff_line>.
ri_html->add( '<tr>' ).
ri_html->add( '<tr class="diff_line">' ).
ri_html->add( |<td class="num diff_others" line-num=""></td>|
&& |<td class="num diff_others" line-num="{ <ls_diff_line>-new_num }"></td>|
&& |<td class="mark diff_others">+</td>|
@ -1062,7 +1062,7 @@ CLASS zcl_abapgit_gui_page_diff IMPLEMENTATION.
CLEAR mt_delayed_lines.
ENDIF.
ri_html->add( '<tr>' ).
ri_html->add( '<tr class="diff_line">' ).
CASE is_diff_line-result.
WHEN zif_abapgit_definitions=>c_diff-update.
APPEND is_diff_line TO mt_delayed_lines. " Delay output of subsequent updates