From: Tim Düsterhus Date: Mon, 15 Jun 2020 08:23:31 +0000 (+0200) Subject: Preserve the scroll position in styleGlobalValues when saving X-Git-Tag: 5.3.0_Alpha_1~212^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b014111d93cd18ff05c345a87e6481f45ec673c9;p=GitHub%2FWoltLab%2FWCF.git Preserve the scroll position in styleGlobalValues when saving Closes #3267 --- diff --git a/wcfsetup/install/files/acp/templates/styleGlobalValues.tpl b/wcfsetup/install/files/acp/templates/styleGlobalValues.tpl index 0408d87e34..51e53478cb 100644 --- a/wcfsetup/install/files/acp/templates/styleGlobalValues.tpl +++ b/wcfsetup/install/files/acp/templates/styleGlobalValues.tpl @@ -28,6 +28,7 @@
+
diff --git a/wcfsetup/install/files/lib/acp/form/StyleGlobalValuesForm.class.php b/wcfsetup/install/files/lib/acp/form/StyleGlobalValuesForm.class.php index 491d76b578..a86b2b551e 100644 --- a/wcfsetup/install/files/lib/acp/form/StyleGlobalValuesForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/StyleGlobalValuesForm.class.php @@ -26,6 +26,12 @@ class StyleGlobalValuesForm extends AbstractForm { * @var string */ public $styles = ''; + + /** + * current scroll offset before submitting the form + * @var integer + */ + public $stylesScrollOffset = 0; /** * @inheritDoc @@ -36,6 +42,9 @@ class StyleGlobalValuesForm extends AbstractForm { if (isset($_POST['styles'])) { $this->styles = StringUtil::unifyNewlines(StringUtil::trim($_POST['styles'])); } + if (isset($_POST['stylesScrollOffset'])) { + $this->stylesScrollOffset = intval($_POST['stylesScrollOffset']); + } } /** @@ -84,7 +93,8 @@ class StyleGlobalValuesForm extends AbstractForm { parent::assignVariables(); WCF::getTPL()->assign([ - 'styles' => $this->styles + 'styles' => $this->styles, + 'stylesScrollOffset' => $this->stylesScrollOffset, ]); } }