X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/08cd85f3bcdc04446ffa0650801b38ebc7eee70f..540ab2ebda6121a52a15f82e531ef8ba558024b1:/modules/documentCanvas/documentCanvas.js diff --git a/modules/documentCanvas/documentCanvas.js b/modules/documentCanvas/documentCanvas.js index f8c21ed..bb8ad4a 100644 --- a/modules/documentCanvas/documentCanvas.js +++ b/modules/documentCanvas/documentCanvas.js @@ -14,6 +14,7 @@ return function(sandbox) { node: $(_.template(template)()), currentNode: null, shownAlready: false, + scrollbarPosition: 0, setup: function() { var view = this; @@ -58,8 +59,12 @@ return function(sandbox) { view.selectFirstNode(); } else if(view.currentNode) { view.movecaretToNode(view.getNodeElement(view.currentNode)); + view.node.find('#rng-module-documentCanvas-contentWrapper').scrollTop(view.scrollbarPosition); } }; + this.node.onHide = function() { + view.scrollbarPosition = view.node.find('#rng-module-documentCanvas-contentWrapper').scrollTop(); + } this.gridToggled = false; },