mirror of
https://github.com/ShaYmez/xlxd.git
synced 2024-09-28 15:56:34 -04:00
Merge pull request #80 from narspt/narspt-patch-2
dashboard: avoid page scroll to top on reloads
This commit is contained in:
commit
14f00b9711
@ -97,12 +97,19 @@ else {
|
||||
<script>
|
||||
var PageRefresh;
|
||||
|
||||
function ReloadPage() {
|
||||
function ReloadPage() {';
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
echo '
|
||||
document.location.href = "./index.php';
|
||||
if (isset($_GET['show'])) {
|
||||
echo '?show='.$_GET['show'];
|
||||
}
|
||||
echo '";
|
||||
echo '";';
|
||||
} else {
|
||||
echo '
|
||||
document.location.reload();';
|
||||
}
|
||||
echo '
|
||||
}';
|
||||
|
||||
if (!isset($_GET['show']) || (($_GET['show'] != 'liveircddb') && ($_GET['show'] != 'reflectors') && ($_GET['show'] != 'interlinks'))) {
|
||||
|
@ -107,21 +107,32 @@ if ($CallingHome['Active']) {
|
||||
if ($PageOptions['PageRefreshActive']) {
|
||||
echo '
|
||||
<script>
|
||||
var PageRefresh;
|
||||
|
||||
function ReloadPage() {
|
||||
function ReloadPage() {';
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
echo '
|
||||
document.location.href = "./index.php';
|
||||
if (isset($_GET['show'])) {
|
||||
echo '?show=' . $_GET['show'];
|
||||
}
|
||||
echo '";
|
||||
echo '";';
|
||||
} else {
|
||||
echo '
|
||||
document.location.reload();';
|
||||
}
|
||||
echo '
|
||||
}';
|
||||
|
||||
if (!isset($_GET['show']) || (($_GET['show'] != 'liveircddb') && ($_GET['show'] != 'reflectors') && ($_GET['show'] != 'interlinks'))) {
|
||||
echo '
|
||||
setTimeout(ReloadPage, ' . $PageOptions['PageRefreshDelay'] . ');';
|
||||
PageRefresh = setTimeout(ReloadPage, ' . $PageOptions['PageRefreshDelay'] . ');';
|
||||
}
|
||||
echo '
|
||||
|
||||
function SuspendPageRefresh() {
|
||||
clearTimeout(PageRefresh);
|
||||
}
|
||||
</script>';
|
||||
}
|
||||
if (!isset($_GET['show'])) $_GET['show'] = "";
|
||||
|
Loading…
Reference in New Issue
Block a user