Try to keep the same scrolling position in the data table view when it gets re-rendered.
git-svn-id: http://google-refine.googlecode.com/svn/trunk@269 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
a7d4951725
commit
f02fd3f5c3
@ -24,7 +24,15 @@ DataTableView.prototype.update = function(onDone) {
|
||||
|
||||
DataTableView.prototype.render = function() {
|
||||
var self = this;
|
||||
var container = this._div.empty();
|
||||
var container = this._div;
|
||||
|
||||
var scrollLeft = 0;
|
||||
var oldTableDiv = container.find(".data-table-container");
|
||||
if (oldTableDiv.length > 0) {
|
||||
scrollLeft = oldTableDiv[0].scrollLeft;
|
||||
}
|
||||
|
||||
container.empty();
|
||||
|
||||
var divSummary = $('<div></div>').addClass("viewPanel-summary").appendTo(container);
|
||||
|
||||
@ -277,6 +285,8 @@ DataTableView.prototype.render = function() {
|
||||
* Finally, inject the table into the DOM
|
||||
*/
|
||||
$(table).appendTo(tableDiv);
|
||||
|
||||
tableDiv[0].scrollLeft = scrollLeft;
|
||||
};
|
||||
|
||||
DataTableView.prototype._showRows = function(start, onDone) {
|
||||
|
Loading…
Reference in New Issue
Block a user