|
1 | 1 | <html><head lang="zh-cn"> |
2 | 2 | <meta charset="UTF-8"> |
3 | 3 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
4 | | - <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=0.5,maximum-scale=2.0,user-scalable=1"> |
| 4 | + <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=0.5,maximum-scale=2.0,user-scalable=1"> |
5 | 5 | <meta name="apple-mobile-web-app-capable" content="yes"> |
6 | 6 | <meta name="apple-mobile-web-app-status-bar-style" content="black"> |
7 | 7 | <meta name="format-detection" content="telephone=no"> |
|
839 | 839 | html.push('<td class="diff-line-num '+prefixClass+'">...</td>'); |
840 | 840 | html.push('<td class="diff-line-num '+prefixClass+'">...</td>'); |
841 | 841 | } else if (prefixClass === 'gi') { |
842 | | - html.push('data-line="'+diffLine.rightNo+'">'); |
| 842 | + html.push('data-line="'+diffLine.rightNo+'" data-type="1">'); |
843 | 843 | html.push('<td class="diff-line-num '+prefixClass+'" ></td>'); |
844 | 844 | html.push('<td class="diff-line-num '+prefixClass+'" line-data="'+diffLine.rightNo+'"></td>'); |
845 | 845 | } else if (prefixClass === 'gd') { |
846 | | - html.push('data-line="'+diffLine.leftNo+'">'); |
| 846 | + html.push('data-line="'+diffLine.leftNo+'" data-type="2">'); |
847 | 847 | html.push('<td class="diff-line-num '+prefixClass+'" line-data="'+diffLine.leftNo+'"></td>'); |
848 | 848 | html.push('<td class="diff-line-num '+prefixClass+'" ></td>'); |
849 | 849 | } else { |
850 | | - html.push('data-line="'+diffLine.leftNo+'">'); |
| 850 | + html.push('data-line="'+diffLine.leftNo+'" data-type="3">'); |
851 | 851 | html.push('<td class="diff-line-num '+prefixClass+'" line-data="'+diffLine.leftNo+'"></td>'); |
852 | 852 | html.push('<td class="diff-line-num '+prefixClass+'" line-data="'+diffLine.rightNo+'"></td>'); |
853 | 853 | } |
|
867 | 867 | htmls.push('data-noteable-id="'+item.noteable_id+'" '); |
868 | 868 | htmls.push('data-id="'+item.id+'" '); |
869 | 869 | htmls.push('data-line="'+item.line+'" '); |
| 870 | + htmls.push('data-type="'+item.change_type+'" '); |
870 | 871 | htmls.push('data-position="'+item.position+'" '); |
871 | 872 | htmls.push('data-path="'+item.path+'" '); |
872 | 873 | htmls.push('>'); |
|
904 | 905 | var generateComments = function(comments) { |
905 | 906 | $.each(comments, function(index, item) { |
906 | 907 | var position = item.position; |
907 | | - var $tr = $('tr[data-position="'+position+'"]'); |
| 908 | + var $tr = item.change_type > 0 ? $('tr[data-line='+item.line+'][data-type='+item.change_type+']') : $('tr[data-position='+item.position+']'); |
908 | 909 | var html = ''; |
909 | 910 | if ($tr.next().hasClass('inline-comments')) { |
910 | 911 | html = drawComment(item); |
|
1013 | 1014 | 'path': path, |
1014 | 1015 | 'position': $this.parent().data('position'), |
1015 | 1016 | 'line': $this.parent().data('line'), |
| 1017 | + 'change_type': $this.parent().data('type'), |
1016 | 1018 | 'anchor': anchor |
1017 | 1019 | }; |
1018 | 1020 | document.location.href = 'coding://line_note?' + $.param(params); |
|
1031 | 1033 | 'path': $this.data('path'), |
1032 | 1034 | 'position': $this.data('position'), |
1033 | 1035 | 'line': $this.data('line'), |
| 1036 | + 'change_type': $this.data('type'), |
1034 | 1037 | 'anchor': anchor |
1035 | 1038 | }; |
1036 | 1039 | document.location.href = 'coding://line_note_comment?' + $.param(params); |
|
0 commit comments