Commit c849cb75 authored by jiameng's avatar jiameng Committed by Commit bot

Fix a scroll-position issue on about:crashes.

Clicking on "Send Now" should not scroll to the top.

This cl patches in the solution devised by phistuck@gmail.com. See bug 659491 for detail.

BUG=659491

Review-Url: https://codereview.chromium.org/2580543002
Cr-Commit-Position: refs/heads/master@{#439022}
parent 180e55bf
...@@ -33,6 +33,9 @@ function updateCrashList( ...@@ -33,6 +33,9 @@ function updateCrashList(
$('disabledMode').hidden = enabled; $('disabledMode').hidden = enabled;
$('crashUploadStatus').hidden = !enabled || !dynamicBackend; $('crashUploadStatus').hidden = !enabled || !dynamicBackend;
// Make the height fixed while clearing the
// element in order to maintain scroll position.
crashSection.style.height = getComputedStyle(crashSection).height;
// Clear any previous list. // Clear any previous list.
crashSection.textContent = ''; crashSection.textContent = '';
...@@ -141,6 +144,8 @@ function updateCrashList( ...@@ -141,6 +144,8 @@ function updateCrashList(
crashSection.appendChild(crashBlock); crashSection.appendChild(crashBlock);
} }
// Reset the height, in order to accommodate for the new content.
crashSection.style.height = "";
$('noCrashes').hidden = crashes.length != 0; $('noCrashes').hidden = crashes.length != 0;
} }
......
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