Commit e3aed751 authored by reed%reedloden.com's avatar reed%reedloden.com

Bug 364952 - "Clicking "Hide/Show Obsolete" link should not scroll show_bug…

Bug 364952 - "Clicking "Hide/Show Obsolete" link should not scroll show_bug page" [p=reed/Hannibal r=LpSolit a=justdave]
parent d8d2ca30
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
function toggle_display(link) { function toggle_display(link) {
var table = document.getElementById("attachment_table"); var table = document.getElementById("attachment_table");
var rows = table.getElementsByTagName("tr"); var rows = table.getElementsByTagName("tr");
var originalHeight = table.offsetHeight; // Store current height for scrolling
var toggle; var toggle;
if (link.innerHTML == "Show Obsolete") { if (link.innerHTML == "Show Obsolete") {
...@@ -40,7 +41,11 @@ ...@@ -40,7 +41,11 @@
if (rows[i].className.match('bz_tr_obsolete')) if (rows[i].className.match('bz_tr_obsolete'))
rows[i].style.display = toggle; rows[i].style.display = toggle;
} }
return true;
var newHeight = table.offsetHeight;
window.scrollBy(0, newHeight - originalHeight);
return false;
} }
//--> //-->
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment