save scroll position
This commit is contained in:
parent
0c226abdc5
commit
47f37858cc
|
@ -3,7 +3,7 @@
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2004 - 2012 Roland Gruber
|
Copyright (C) 2004 - 2013 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -145,7 +145,7 @@ foreach ($jsFiles as $jsEntry) {
|
||||||
// print error messages
|
// print error messages
|
||||||
for ($i = 0; $i < sizeof($errorsToDisplay); $i++) call_user_func_array('StatusMessage', $errorsToDisplay[$i]);
|
for ($i = 0; $i < sizeof($errorsToDisplay); $i++) call_user_func_array('StatusMessage', $errorsToDisplay[$i]);
|
||||||
|
|
||||||
echo ("<form action=\"confmodules.php\" method=\"post\">\n");
|
echo ("<form id=\"inputForm\" action=\"confmodules.php\" method=\"post\" onSubmit=\"saveScrollPosition('inputForm')\">\n");
|
||||||
|
|
||||||
// hidden submit buttons which are clicked by tabs
|
// hidden submit buttons which are clicked by tabs
|
||||||
echo "<div style=\"display: none;\">\n";
|
echo "<div style=\"display: none;\">\n";
|
||||||
|
@ -230,6 +230,16 @@ $buttonContainer->addElement($cancelButton, true);
|
||||||
$buttonContainer->addElement(new htmlSpacer(null, '10px'), true);
|
$buttonContainer->addElement(new htmlSpacer(null, '10px'), true);
|
||||||
parseHtml(null, $buttonContainer, array(), false, $tabindex, 'user');
|
parseHtml(null, $buttonContainer, array(), false, $tabindex, 'user');
|
||||||
|
|
||||||
|
if ((sizeof($errorsToDisplay) == 0) && isset($_POST['scrollPositionTop']) && isset($_POST['scrollPositionLeft'])) {
|
||||||
|
// scroll to last position
|
||||||
|
echo '<script type="text/javascript">
|
||||||
|
jQuery(document).ready(function() {
|
||||||
|
jQuery(window).scrollTop(' . $_POST['scrollPositionTop'] . ');
|
||||||
|
jQuery(window).scrollLeft('. $_POST['scrollPositionLeft'] . ');
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
|
}
|
||||||
|
|
||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
echo "</body>\n";
|
echo "</body>\n";
|
||||||
echo "</html>\n";
|
echo "</html>\n";
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
$Id$
|
$Id$
|
||||||
|
|
||||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||||
Copyright (C) 2009 - 2012 Roland Gruber
|
Copyright (C) 2009 - 2013 Roland Gruber
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -144,7 +144,7 @@ foreach ($jsFiles as $jsEntry) {
|
||||||
// print error messages
|
// print error messages
|
||||||
for ($i = 0; $i < sizeof($errorsToDisplay); $i++) call_user_func_array('StatusMessage', $errorsToDisplay[$i]);
|
for ($i = 0; $i < sizeof($errorsToDisplay); $i++) call_user_func_array('StatusMessage', $errorsToDisplay[$i]);
|
||||||
|
|
||||||
echo ("<form action=\"moduleSettings.php\" method=\"post\" autocomplete=\"off\">\n");
|
echo ("<form id=\"inputForm\" action=\"moduleSettings.php\" method=\"post\" autocomplete=\"off\" onSubmit=\"saveScrollPosition('inputForm')\">\n");
|
||||||
|
|
||||||
// hidden submit buttons which are clicked by tabs
|
// hidden submit buttons which are clicked by tabs
|
||||||
echo "<div style=\"display: none;\">\n";
|
echo "<div style=\"display: none;\">\n";
|
||||||
|
@ -241,6 +241,16 @@ $buttonContainer->addElement($cancelButton, true);
|
||||||
$buttonContainer->addElement(new htmlSpacer(null, '10px'), true);
|
$buttonContainer->addElement(new htmlSpacer(null, '10px'), true);
|
||||||
parseHtml(null, $buttonContainer, array(), false, $tabindex, 'user');
|
parseHtml(null, $buttonContainer, array(), false, $tabindex, 'user');
|
||||||
|
|
||||||
|
if ((sizeof($errorsToDisplay) == 0) && isset($_POST['scrollPositionTop']) && isset($_POST['scrollPositionLeft'])) {
|
||||||
|
// scroll to last position
|
||||||
|
echo '<script type="text/javascript">
|
||||||
|
jQuery(document).ready(function() {
|
||||||
|
jQuery(window).scrollTop(' . $_POST['scrollPositionTop'] . ');
|
||||||
|
jQuery(window).scrollLeft('. $_POST['scrollPositionLeft'] . ');
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
|
}
|
||||||
|
|
||||||
echo "</form>\n";
|
echo "</form>\n";
|
||||||
echo "</body>\n";
|
echo "</body>\n";
|
||||||
echo "</html>\n";
|
echo "</html>\n";
|
||||||
|
|
|
@ -88,7 +88,7 @@ if ((isset($_GET['headline'])) && ($_GET['logoFile'] != $_SESSION['currentPageDe
|
||||||
if ((isset($_GET['headline'])) && ($_GET['headline'] != $_SESSION['currentPageDefinitions']['headline'])) {
|
if ((isset($_GET['headline'])) && ($_GET['headline'] != $_SESSION['currentPageDefinitions']['headline'])) {
|
||||||
$_SESSION['currentPageDefinitions']['headline'] = str_replace('<','',str_replace('>','',$_GET['headline']));
|
$_SESSION['currentPageDefinitions']['headline'] = str_replace('<','',str_replace('>','',$_GET['headline']));
|
||||||
}
|
}
|
||||||
if ((isset($_GET['foldingmarks'])) && ($_GET['foldingmarks'] != $_SESSION['currentPageDefinitions']['foldingmarks'])) {
|
if ((isset($_GET['foldingmarks'])) && (!isset($_SESSION['currentPageDefinitions']['foldingmarks']) || ($_GET['foldingmarks'] != $_SESSION['currentPageDefinitions']['foldingmarks']))) {
|
||||||
$_SESSION['currentPageDefinitions']['foldingmarks'] = $_GET['foldingmarks'];
|
$_SESSION['currentPageDefinitions']['foldingmarks'] = $_GET['foldingmarks'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -439,7 +439,7 @@ if (isset($_SESSION['currentPageDefinitions']['filename'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<form action="pdfpage.php" method="post">
|
<form id="inputForm" action="pdfpage.php" method="post" onSubmit="saveScrollPosition('inputForm')">
|
||||||
<?php
|
<?php
|
||||||
$sectionElements = array(_('Beginning') => 0);
|
$sectionElements = array(_('Beginning') => 0);
|
||||||
$nonTextSectionElements = array();
|
$nonTextSectionElements = array();
|
||||||
|
@ -612,6 +612,16 @@ $container->addElement($buttonContainer, true);
|
||||||
$tabindex = 1;
|
$tabindex = 1;
|
||||||
parseHtml(null, $container, array(), false, $tabindex, $_GET['type']);
|
parseHtml(null, $container, array(), false, $tabindex, $_GET['type']);
|
||||||
|
|
||||||
|
if ((sizeof($saveErrors) == 0) && isset($_POST['scrollPositionTop']) && isset($_POST['scrollPositionLeft'])) {
|
||||||
|
// scroll to last position
|
||||||
|
echo '<script type="text/javascript">
|
||||||
|
jQuery(document).ready(function() {
|
||||||
|
jQuery(window).scrollTop(' . $_POST['scrollPositionTop'] . ');
|
||||||
|
jQuery(window).scrollLeft('. $_POST['scrollPositionLeft'] . ');
|
||||||
|
});
|
||||||
|
</script>';
|
||||||
|
}
|
||||||
|
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
include '../main_footer.php';
|
include '../main_footer.php';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue