X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/08cd85f3bcdc04446ffa0650801b38ebc7eee70f..3ef4adb18d58aa2570142c19762e4f2a48cb0d1b:/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; },