Skip to content

Commit

Permalink
Make onUnload optional in Frame
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaip committed Mar 7, 2018
1 parent e317161 commit ba54fda
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/neos-ui/src/Containers/LeftSideBar/NodeTree/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,18 @@ export default class NodeTree extends PureComponent {
focus(contextPath);
}

handleClick = src => {
const {setActiveContentCanvasSrc, requestScrollIntoView} = this.props;
handleClick = (src, contextPath) => {
const {setActiveContentCanvasSrc, setActiveContentCanvasContextPath, requestScrollIntoView} = this.props;
// Set a flag that will imperatively tell ContentCanvas to scroll to focused node
if (requestScrollIntoView) {
requestScrollIntoView(true);
}
if (setActiveContentCanvasSrc) {
setActiveContentCanvasSrc(src);
}
if (setActiveContentCanvasContextPath) {
setActiveContentCanvasContextPath(contextPath);
}
}

handleDrag = node => {
Expand Down Expand Up @@ -104,6 +107,7 @@ export const PageTree = connect(state => ({
toggle: actions.UI.PageTree.toggle,
focus: actions.UI.PageTree.focus,
setActiveContentCanvasSrc: actions.UI.ContentCanvas.setSrc,
setActiveContentCanvasContextPath: actions.UI.ContentCanvas.setContextPath,
moveNode: actions.CR.Nodes.move,
requestScrollIntoView: null
})(NodeTree);
Expand Down

0 comments on commit ba54fda

Please sign in to comment.