oracle / opengrok

OpenGrok is a fast and usable source code search and cross reference engine, written in Java
http://oracle.github.io/opengrok/
Other
4.33k stars 746 forks source link

Search windows is overlapping the menu #2871

Open marceloavilaoliveira opened 5 years ago

marceloavilaoliveira commented 5 years ago

This is the correct way OpenGrok shows the results:

OpenGrok-1 But the search window overlaps the menu if something is added to data/header_include file:

OpenGrok-2 The same happens if the xref line is too long and/or the window is too short:

OpenGrok-3

vladak commented 5 years ago

The header_include part is a dup of #2841 - the workaround is to avoid putting too high elements in the include.

The long xref is the biggest problem I think.

marceloavilaoliveira commented 5 years ago

What do you mean by "too high elements" in the include? I got the same issue if I simply put the following in the header_include:

<a href="https://opengrok.cpqd.com.br">
    <img src="/images/opengrok.png"/>
</a>

Could you point to a header_include example which works?

vladak commented 5 years ago

single line of text works for me.

marceloavilaoliveira commented 5 years ago

Actually, even just a single line with a tiny font doesn't work pretty well:

S2019_07_23-01

Anyway just one line in the header isn't good enough :-(

ghost commented 4 years ago

Following change can resolve the issue:

diff --git a/opengrok-web/src/main/webapp/default/style.css b/opengrok-web/src/main/webapp/default/style.css
index e66842c..8a28a51 100644
--- a/opengrok-web/src/main/webapp/default/style.css
+++ b/opengrok-web/src/main/webapp/default/style.css
@@ -276,7 +276,7 @@ html.diff #whole_header {
     position: fixed;
     top: 0;
     background: #ffffff;
-    height: 70px;
+    margin-bottom: 5px;
     width: 100%;
 }

@@ -473,7 +473,7 @@ html.xref #content,
 html.diff #content,
 html.more #content,
 html.history #content{
-    margin-top: 70px;
+    display: none;
 }

 /* *** help page *** */
diff --git a/opengrok-web/src/main/webapp/js/utils-0.0.31.js b/opengrok-web/src/main/webapp/js/utils-0.0.31.js
index 4a17bd8..440ff9b 100644
--- a/opengrok-web/src/main/webapp/js/utils-0.0.31.js
+++ b/opengrok-web/src/main/webapp/js/utils-0.0.31.js
@@ -2429,3 +2429,9 @@ function getCookie(cname) {
     }
     return "";
 }
+
+$(document).ready(function() {
+    whole_header_bottom = $('#whole_header').position().top + $('#whole_header').outerHeight(true);
+    $('#content').css('margin-top', whole_header_bottom);
+    $('#content').show();
+});
marceloavilaoliveira commented 4 years ago

Following change can resolve the issue:

I made these changes up to the 1.2.25 version but the result was not good. The overlap issue wasn't fixed and the URL line anchors in the search results aren't working anymore.

For example, if we click on the link below

https://OPENGROK-SERVER/source/xref/PROJECT/PATH/FILENAME#28

The browser doesn't go to the line 28 of the filename.