Defect #33896
closedIncorrect position of the revision graph
Added by Go MAEDA over 6 years ago. Updated about 6 years ago.
Description
See the screenshot below. The trunk is affected, 4.1-stable is not affected.

Files
| incorrect-position-of-revision-graph.png (155 KB) incorrect-position-of-revision-graph.png | Go MAEDA, 2020-08-24 04:58 | ||
| 33896.patch (2.14 KB) 33896.patch | Takenori TAKAKI, 2020-09-04 05:59 | ||
| before.png (272 KB) before.png | Marius BĂLTEANU, 2020-10-05 00:35 | ||
| after.png (292 KB) after.png | Marius BĂLTEANU, 2020-10-05 00:35 | ||
| fix-view-differences-buttons.patch (1.1 KB) fix-view-differences-buttons.patch | Mizuki ISHIKAWA, 2020-11-11 05:12 |
Updated by Go MAEDA over 6 years ago
Actions
#1
The issue is likely to have been caused by r19803.
Updated by Go MAEDA over 6 years ago
Actions
#2
- Related to Feature #33383: Update jQuery to 3.5.1 added
Updated by Marius BĂLTEANU over 6 years ago
Actions
#3
- Assignee set to Marius BĂLTEANU
Updated by Takenori TAKAKI over 6 years ago
Actions
#4
- File 33896.patch 33896.patch added
It seems to be caused by a change in jQuery that changed the value returned from position().top.
The problem seems to be fix, by replacing calculation using offset().top.
Updated by Marius BĂLTEANU about 6 years ago
Actions
#5
- File after.png after.png added
- File before.png before.png added
- Assignee deleted (
Marius BĂLTEANU)
I think the problem is related to this change: https://jquery.com/upgrade-guide/3.0/#offset.
Takenori, thanks for looking into this, I've tested your patch and it fixes the problem, but looking deeper in the code and in the DOM, I think it's better to fix this by moving the "View differences" buttons outside the autoscroll block. Doing this, we fix another issue generated by the same cause, the buttons are no longer visibile when you scroll to right, please see the attached screenshots.
What do you think about this fix?
diff --git a/app/views/repositories/_revisions.html.erb b/app/views/repositories/_revisions.html.erb
index 95c6898a1..c7aad5f1e 100644
--- a/app/views/repositories/_revisions.html.erb
+++ b/app/views/repositories/_revisions.html.erb
@@ -1,3 +1,9 @@
+<% show_diff = revisions.size > 1 && User.current.allowed_to?(:browse_repository, @repository.project) %>
+<% if show_diff %>
+<p>
+ <%= submit_tag(l(:label_view_diff), :name => nil) %>
+</p>
+<% end %>
<div class="autoscroll">
<% show_revision_graph = ( @repository.supports_revision_graph? && path.blank? ) %>
<%= if show_revision_graph && revisions && revisions.any?
@@ -20,12 +26,6 @@ end %>
:repository_id => @repository.identifier_param, :path => to_path_param(path)},
:method => :get
) do %>
-<% show_diff = revisions.size > 1 && User.current.allowed_to?(:browse_repository, @repository.project) %>
-<% if show_diff %>
-<p>
- <%= submit_tag(l(:label_view_diff), :name => nil) %>
-</p>
-<% end %>
<table class="list changesets">
<thead><tr>
<th>#</th>
@@ -53,10 +53,10 @@ end %>
<% end %>
</tbody>
</table>
+<% end %>
+</div>
<% if show_diff %>
<p>
<%= submit_tag(l(:label_view_diff), :name => nil) %>
</p>
<% end %>
-<% end %>
-</div>
Updated by Marius BĂLTEANU about 6 years ago
Actions
#6
- Target version set to 4.2.0
Updated by Takenori TAKAKI about 6 years ago
Actions
#7
Thanks Marius.
I think your patch is a better improvement.
I felt it was better as a DOM structure as well.
Updated by Go MAEDA about 6 years ago
Actions
#8
- Status changed from New to Closed
- Assignee set to Go MAEDA
- Target version deleted (
4.2.0) - Resolution set to Fixed
Committed the patch #33896#note-5. Thank you.
Updated by Mizuki ISHIKAWA about 6 years ago
Actions
#9
This change resolves the visual probrem, but instead the "View differences" buttons no longer works.
The cause is that submit_tag has been moved out of the form tag.
The attached patch solves the problem by changing the position of the form tag.
Updated by Go MAEDA about 6 years ago
Actions
#10
- Status changed from Closed to Reopened
Updated by Go MAEDA about 6 years ago
Actions
#11
- Status changed from Reopened to Closed
Mizuki ISHIKAWA wrote:
This change resolves the visual probrem, but instead the "View differences" buttons no longer works.
The cause is that submit_tag has been moved out of the form tag.
Committed the fix in r20336. Thank you.