Defect #33896
closedIncorrect position of the revision graph
0%
Description
See the screenshot below. The trunk is affected, 4.1-stable is not affected.
Files
Related issues
Updated by Go MAEDA over 4 years ago
The issue is likely to have been caused by r19803.
Updated by Go MAEDA over 4 years ago
- Related to Feature #33383: Update jQuery to 3.5.1 added
Updated by Takenori TAKAKI over 4 years ago
- 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 4 years ago
- 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 Takenori TAKAKI about 4 years ago
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 4 years ago
- 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 4 years ago
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 4 years ago
- 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.