dashboard2: use location.reload() to keep page scroll position

use location.reload() to keep page scroll position on page refreshes, but keep using location.href method for POST requests to avoid browser asking to resubmit data on reloads
This commit is contained in:
narspt 2018-02-03 01:32:25 +00:00 committed by GitHub
parent 7ec97b2c9e
commit 27377a4d62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 3 deletions

View File

@ -108,12 +108,19 @@ if ($CallingHome['Active']) {
echo '
<script>
function ReloadPage() {
function ReloadPage() {';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
echo '
document.location.href = "./index.php';
if (isset($_GET['show'])) {
if (isset($_GET['show'])) {
echo '?show=' . $_GET['show'];
}
echo '";';
} else {
echo '
document.location.reload();';
}
echo '";
echo '
}';
if (!isset($_GET['show']) || (($_GET['show'] != 'liveircddb') && ($_GET['show'] != 'reflectors') && ($_GET['show'] != 'interlinks'))) {