summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-02-22 15:48:12 +0100
committerJulien Lancelot <julien.lancelot@gmail.com>2013-02-22 15:48:35 +0100
commitf91e16c9baea6ec4941a3c0a0be241b1dcd8f62b (patch)
tree0b266b1540a1f2ec616262ff3653403266b4ad19
parent03ff208f8cf5b32b0efb03ec748c2c8cd835a722 (diff)
downloadsonarqube-f91e16c9baea6ec4941a3c0a0be241b1dcd8f62b.tar.gz
sonarqube-f91e16c9baea6ec4941a3c0a0be241b1dcd8f62b.zip
Fix issue when changing tab from resource viewer and copyright were moved in the middle of the source
-rw-r--r--sonar-server/src/main/webapp/javascripts/application.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/sonar-server/src/main/webapp/javascripts/application.js b/sonar-server/src/main/webapp/javascripts/application.js
index 7fb13201a7c..3dfadcb806f 100644
--- a/sonar-server/src/main/webapp/javascripts/application.js
+++ b/sonar-server/src/main/webapp/javascripts/application.js
@@ -367,11 +367,17 @@ function openAccordionItem(url, elt, updateCurrentElement) {
}
if (updateCurrentElement) {
+ var currentElementOffset = currentElement.offset();
+
// Fix the height in order to not change the position on the screen
- var prev = $j("#accordion-panel").height();
+ var prevHeight = $j("#accordion-panel").height();
currentElement.replaceWith(html);
- if (prev > $j("#accordion-panel").height()) {
- $j("#accordion-panel").height(prev);
+ $j("#accordion-panel").height('auto');
+ var newHeight = $j("#accordion-panel").height();
+ if (prevHeight > newHeight) {
+ $j("#accordion-panel").height(prevHeight);
+ } else {
+ $j("#accordion-panel").height(newHeight);
}
} else {
// Add new item add the end of the panel and restore the height param