diff --git a/javascript/CMSMain.Tree.js b/javascript/CMSMain.Tree.js index e866f440..5c3d2bc5 100644 --- a/javascript/CMSMain.Tree.js +++ b/javascript/CMSMain.Tree.js @@ -110,6 +110,18 @@ return config; } }); + + // Scroll tree down to context of the current page + $('.cms-tree a.jstree-clicked').entwine({ + onmatch: function(){ + var self = this, + panel = self.parents('.cms-panel-content'); + + panel.animate({ + scrollTop: self.offset().top - (panel.height() / 2) + }, 'slow'); + } + }); }); }(jQuery));