File tree Expand file tree Collapse file tree 4 files changed +28
-20
lines changed Expand file tree Collapse file tree 4 files changed +28
-20
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ The element tags are the bread and butter of your slide content. Most of these t
216216
217217####\< Appear />
218218
219- This tag does not extend from Base. It's special. Wrapping elements in the appear tag makes them appear/disappear in order in response to navigation.
219+ This tag does not extend from Base. It's special. Wrapping elements in the appear tag makes them appear/disappear in order in response to navigation. The Appear tag requires adding ` fid ` tags that are unique within a given slide. This requirement will go away in React 0.14.
220220
221221####\< BlockQuote />, \< Quote/> and \< Cite /> (Base)
222222
Original file line number Diff line number Diff line change @@ -49,17 +49,17 @@ export default class extends React.Component {
4949 margin = "20px auto" />
5050 </ Slide >
5151 < Slide transition = { [ "slide" ] } bgImage = { images . city . replace ( "/" , "" ) } bgDarken = { 0.75 } >
52- < Appear >
52+ < Appear fid = "1" >
5353 < Heading size = { 1 } caps fit textColor = "primary" >
5454 Full Width
5555 </ Heading >
5656 </ Appear >
57- < Appear >
57+ < Appear fid = "2" >
5858 < Heading size = { 1 } caps fit textColor = "tertiary" >
5959 Adjustable Darkness
6060 </ Heading >
6161 </ Appear >
62- < Appear >
62+ < Appear fid = "3" >
6363 < Heading size = { 1 } caps fit textColor = "primary" >
6464 Background Imagery
6565 </ Heading >
@@ -96,12 +96,12 @@ export default class extends React.Component {
9696 </ Slide >
9797 < Slide transition = { [ "fade" ] } bgColor = "secondary" textColor = "primary" >
9898 < List >
99- < ListItem > < Appear > Inline style based theme system</ Appear > </ ListItem >
100- < ListItem > < Appear > Autofit text</ Appear > </ ListItem >
101- < ListItem > < Appear > Flexbox layout system</ Appear > </ ListItem >
102- < ListItem > < Appear > React-Router navigation</ Appear > </ ListItem >
103- < ListItem > < Appear > PDF export</ Appear > </ ListItem >
104- < ListItem > < Appear > And...</ Appear > </ ListItem >
99+ < ListItem > < Appear fid = "1" > Inline style based theme system</ Appear > </ ListItem >
100+ < ListItem > < Appear fid = "2" > Autofit text</ Appear > </ ListItem >
101+ < ListItem > < Appear fid = "3" > Flexbox layout system</ Appear > </ ListItem >
102+ < ListItem > < Appear fid = "4" > React-Router navigation</ Appear > </ ListItem >
103+ < ListItem > < Appear fid = "5" > PDF export</ Appear > </ ListItem >
104+ < ListItem > < Appear fid = "6" > And...</ Appear > </ ListItem >
105105 </ List >
106106 </ Slide >
107107 < Slide transition = { [ "slide" ] } bgColor = "primary" >
Original file line number Diff line number Diff line change @@ -16,27 +16,22 @@ const Appear = React.createClass({
1616 getInitialState ( ) {
1717 return {
1818 active : false ,
19- opacity : 0
19+ opacity : this . context . export || this . context . overview ? 1 : 0
2020 } ;
2121 } ,
2222 componentDidMount ( ) {
2323 this . context . flux . stores . SlideStore . listen ( this . _storeChange ) ;
2424 const slide = this . context . slide ;
25- this . context . flux . actions . SlideActions . addFragment ( {
26- slide,
27- id : this . _reactInternalInstance . _rootNodeID ,
28- visible : false
29- } ) ;
3025 } ,
3126 componentWillUnmount ( ) {
3227 this . context . flux . stores . SlideStore . unlisten ( this . _storeChange ) ;
3328 } ,
3429 _storeChange ( state ) {
3530 const slide = this . context . slide ;
3631 const key = _ . findKey ( state . fragments [ slide ] , {
37- "id" : this . _reactInternalInstance . _rootNodeID
32+ "id" : this . props . fid
3833 } ) ;
39- if ( state . fragments [ slide ] . hasOwnProperty ( key ) ) {
34+ if ( slide in state . fragments && state . fragments [ slide ] . hasOwnProperty ( key ) ) {
4035 this . setState ( {
4136 active : state . fragments [ slide ] [ key ] . visible
4237 } , ( ) => {
@@ -57,7 +52,7 @@ const Appear = React.createClass({
5752 opacity : this . getTweeningValue ( "opacity" )
5853 } ;
5954 return (
60- < div style = { styles } className = "fragment" >
55+ < div style = { styles } className = "fragment" data-fid = { this . props . fid } >
6156 { this . props . children }
6257 </ div >
6358 ) ;
Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ const Slide = React.createClass({
2626 styles : React . PropTypes . object ,
2727 export : React . PropTypes . bool ,
2828 print : React . PropTypes . bool ,
29- overview : React . PropTypes . bool
29+ overview : React . PropTypes . bool ,
30+ flux : React . PropTypes . object
3031 } ,
3132 getInitialState ( ) {
3233 return {
@@ -47,6 +48,17 @@ const Slide = React.createClass({
4748 } ,
4849 componentDidMount ( ) {
4950 this . setZoom ( ) ;
51+ const slide = React . findDOMNode ( this . refs . slide ) ;
52+ const frags = slide . querySelectorAll ( ".fragment" ) ;
53+ if ( frags && frags . length ) {
54+ Array . prototype . slice . call ( frags , 0 ) . forEach ( ( frag ) => {
55+ this . context . flux . actions . SlideActions . addFragment ( {
56+ slide : this . props . slideIndex ,
57+ id : frag . dataset . fid ,
58+ visible : false
59+ } ) ;
60+ } )
61+ }
5062 window . addEventListener ( "load" , this . setZoom ) ;
5163 window . addEventListener ( "resize" , this . setZoom ) ;
5264 } ,
@@ -88,6 +100,7 @@ const Slide = React.createClass({
88100 } ;
89101 return (
90102 < div className = "spectacle-slide"
103+ ref = "slide"
91104 style = { [
92105 styles . outer ,
93106 this . getStyles ( ) ,
You can’t perform that action at this time.
0 commit comments