From 86de3d933ca1ec27b96cbbfc74266c251397d9df Mon Sep 17 00:00:00 2001 From: Bruno Mota Date: Thu, 1 Oct 2015 10:03:37 +0100 Subject: [PATCH] page public display through context fix --- lib/components/elements/button/index.jsx | 2 +- lib/components/page/index.jsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/components/elements/button/index.jsx b/lib/components/elements/button/index.jsx index 4696f5195..fe1ce0983 100644 --- a/lib/components/elements/button/index.jsx +++ b/lib/components/elements/button/index.jsx @@ -114,7 +114,7 @@ Button.propTypes = { Button.contextTypes = { editing: React.PropTypes.bool.isRequired, - elementContentChange: React.PropTypes.func.isRequired, + elementContentChange: React.PropTypes.func, selected: React.PropTypes.any }; diff --git a/lib/components/page/index.jsx b/lib/components/page/index.jsx index 7ad43b873..aa0da5c2d 100644 --- a/lib/components/page/index.jsx +++ b/lib/components/page/index.jsx @@ -86,7 +86,8 @@ export default class Page extends Component { getChildContext () { return { editing: false, - renderElement: this.renderElementBind + renderElement: this.renderElementBind, + display: this.state.display }; } @@ -137,5 +138,6 @@ Page.propTypes = { Page.childContextTypes = { editing: React.PropTypes.bool.isRequired, - renderElement: React.PropTypes.func.isRequired + renderElement: React.PropTypes.func.isRequired, + display: React.PropTypes.string.isRequired };