From 53553834328f43ffd06c805c940b18738349ab94 Mon Sep 17 00:00:00 2001 From: cajus Date: Tue, 19 Jan 2010 09:26:11 +0000 Subject: [PATCH] Save scroll position git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15191 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_sortableListing.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gosa-core/include/class_sortableListing.inc b/gosa-core/include/class_sortableListing.inc index 9ea6d40ee..0e346f8ad 100644 --- a/gosa-core/include/class_sortableListing.inc +++ b/gosa-core/include/class_sortableListing.inc @@ -205,6 +205,7 @@ class sortableListing { } $result.= " \n\n\n"; + $result.= " \n"; $result.= " \n"; // Append script stuff if needed @@ -216,7 +217,11 @@ class sortableListing { $result.= ' document.mainform.submit();'; $result.= ' }'; $result.= 'Position.includeScrollOffsets = true;'; - $result.= ' Sortable.create(\''.$this->id.'\',{tag:\'tr\', ghosting:false,constraint:\'vertical\', scroll:\'scroll_'.$this->id.'\',onUpdate : updateOrder})'; + $result.= ' Sortable.create(\''.$this->id.'\',{tag:\'tr\', ghosting:false, constraint:\'vertical\', scroll:\'scroll_'.$this->id.'\',onUpdate : updateOrder});'; + if (isset($_POST['position_'.$this->id]) && is_numeric($_POST['position_'.$this->id])) { + $result.= '$("scroll_'.$this->id.'").scrollTop= '.$_POST['position_'.$this->id].';'; + } + $result.= 'var box = $("scroll_'.$this->id.'").onscroll= function() {$("position_'.$this->id.'").value= this.scrollTop;}'; $result.= ''; return $result; -- 2.30.2