mirror of
https://github.com/jxnblk/mdx-deck.git
synced 2024-11-26 00:35:02 +03:00
Store presenter mode in querystring
This commit is contained in:
parent
36a5af82b7
commit
4ee0ef190b
@ -33,6 +33,7 @@
|
||||
"pkg-conf": "^2.1.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"puppeteer": "^1.6.1",
|
||||
"querystring": "^0.2.0",
|
||||
"react": "^16.4.1",
|
||||
"react-dev-utils": "^5.0.1",
|
||||
"remark-emoji": "^2.0.1",
|
||||
|
10
src/Notes.js
10
src/Notes.js
@ -16,16 +16,6 @@ export default withDeck(withSlide(class extends React.Component {
|
||||
this.setNotes(this.props)
|
||||
}
|
||||
|
||||
/* todo
|
||||
componentWillUpdate (next) {
|
||||
this.setNotes(next)
|
||||
}
|
||||
|
||||
shouldComponentUpdate (next) {
|
||||
return next.children !== this.props.children
|
||||
}
|
||||
*/
|
||||
|
||||
render () {
|
||||
return false
|
||||
}
|
||||
|
@ -135,8 +135,11 @@ export class SlideDeck extends React.Component {
|
||||
this.isHashChange = false
|
||||
return
|
||||
}
|
||||
const { index } = this.state
|
||||
history.pushState(null, null, '#' + index)
|
||||
const { index, mode } = this.state
|
||||
let query = ''
|
||||
if (mode === modes.presenter) query += 'presenter'
|
||||
query = query ? '?' + query : ''
|
||||
history.pushState(null, null, query + '#' + index)
|
||||
localStorage.setItem('mdx-slide', index)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user