Defect #33896
Incorrect position of the revision graph
Status: | Closed | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | % Done: | 0% | ||
Category: | SCM | |||
Target version: | - | |||
Resolution: | Fixed | Affected version: |
Description
See the screenshot below. The trunk is affected, 4.1-stable is not affected.
Related issues
Associated revisions
History
#1
Updated by Go MAEDA over 1 year ago
The issue is likely to have been caused by r19803.
#2
Updated by Go MAEDA over 1 year ago
- Related to Feature #33383: Update jQuery to 3.5.1 added
#3
Updated by Marius BALTEANU over 1 year ago
- Assignee set to Marius BALTEANU
#4
Updated by Takenori TAKAKI over 1 year ago
- File 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.
#5
Updated by Marius BALTEANU over 1 year ago
- File after.png added
- File before.png added
- Assignee deleted (
Marius BALTEANU)
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>
#6
Updated by Marius BALTEANU over 1 year ago
- Target version set to 4.2.0
#7
Updated by Takenori TAKAKI over 1 year ago
Thanks Marius.
I think your patch is a better improvement.
I felt it was better as a DOM structure as well.
#8
Updated by Go MAEDA over 1 year 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.
#9
Updated by Mizuki ISHIKAWA over 1 year ago
- File fix-view-differences-buttons.patch
added
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.
#10
Updated by Go MAEDA over 1 year ago
- Status changed from Closed to Reopened
#11
Updated by Go MAEDA over 1 year 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.