diff --git a/js/components/ascribe_slides_container/slides_container.js b/js/components/ascribe_slides_container/slides_container.js index 9a3f2269..95c5859f 100644 --- a/js/components/ascribe_slides_container/slides_container.js +++ b/js/components/ascribe_slides_container/slides_container.js @@ -11,7 +11,6 @@ let Navigation = Router.Navigation; let SlidesContainer = React.createClass({ propTypes: { - breadcrumbs: React.PropTypes.arrayOf(React.PropTypes.string), children: React.PropTypes.arrayOf(React.PropTypes.element), forwardProcess: React.PropTypes.bool.isRequired }, @@ -135,15 +134,31 @@ let SlidesContainer = React.createClass({ } }, - renderBreadCrumbs() { - if (this.props.breadcrumbs) { - let numSlides = this.props.breadcrumbs.length; + extractBreadcrumbs() { + let breadcrumbs = []; + + ReactAddons.Children.map(this.props.children, (child) => { + breadcrumbs.push(child.props['data-slide-title']); + }); + + return breadcrumbs; + }, + + renderBreadcrumbs() { + let breadcrumbs = this.extractBreadcrumbs(); + let numOfChildren = React.Children.count(this.props.children); + + // check if every child/slide has a title, + // otherwise do not display the breadcrumbs at all + if(breadcrumbs.length === numOfChildren) { + let numSlides = breadcrumbs.length; let columnWidth = Math.floor(12 / numSlides); + return (