Project

General

Profile

Actions

Defect #33896

closed

Incorrect position of the revision graph

Added by Go MAEDA over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
SCM
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

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

Related issues

Related to Redmine - Feature #33383: Update jQuery to 3.5.1ClosedGo MAEDA

Actions
Actions #1

Updated by Go MAEDA over 4 years ago

The issue is likely to have been caused by r19803.

Actions #2

Updated by Go MAEDA over 4 years ago

Actions #3

Updated by Marius BĂLTEANU over 4 years ago

  • Assignee set to Marius BĂLTEANU
Actions #4

Updated by Takenori TAKAKI over 4 years ago

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.

Actions #5

Updated by Marius BĂLTEANU about 4 years ago

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>

Actions #6

Updated by Marius BĂLTEANU about 4 years ago

  • Target version set to 4.2.0
Actions #7

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.

Actions #8

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.

Actions #9

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.

Actions #10

Updated by Go MAEDA about 4 years ago

  • Status changed from Closed to Reopened
Actions #11

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.

Actions

Also available in: Atom PDF