1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

added fullscreen button for notes and snippets

allows user to hide the sidebars for fullscreen editing
This commit is contained in:
Kevin Nadro
2017-05-27 20:22:51 -05:00
committed by asmsuechan
parent 48ca13f82c
commit 5d0cb0302e
4 changed files with 97 additions and 2 deletions

View File

@@ -30,7 +30,14 @@ class MarkdownNoteDetail extends React.Component {
content: ''
}, props.note),
isLockButtonShown: false,
isLocked: false
isLocked: false,
fullScreen: {
status: false,
oldState: {
nd : 0,
mb : 0
}
}
}
this.dispatchTimer = null
@@ -196,6 +203,34 @@ class MarkdownNoteDetail extends React.Component {
}
}
handleFullScreenButton (e) {
this.state.fullScreen.status = !this.state.fullScreen.status
const noteDetail = document.querySelector(".NoteDetail")
const mainBody = document.querySelector(".Main__body___browser-main-")
const sliderRight = document.querySelector(".Main__slider-right___browser-main-")
const slider = document.querySelector(".Main__slider___browser-main-")
if(this.state.fullScreen.status) {
this.state.fullScreen.oldState.nd = noteDetail.style.left
this.state.fullScreen.oldState.mb = mainBody.style.left
noteDetail.style.left = "0px"
mainBody.style.left = "0px"
sliderRight.style.display = 'none'
slider.style.display = 'none'
}else {
noteDetail.style.left = this.state.fullScreen.oldState.nd
mainBody.style.left = this.state.fullScreen.oldState.mb
sliderRight.style.display = 'block'
slider.style.display = 'block'
}
}
handleLockButtonMouseDown (e) {
e.preventDefault()
ee.emit('editor:lock')
@@ -287,6 +322,11 @@ class MarkdownNoteDetail extends React.Component {
</g>
</svg>
</button>
<button styleName='control-fullScreenButton'
onMouseDown={(e) => this.handleFullScreenButton(e)}
>
<i className={'fa fa-arrows-alt'} styleName='fullScreen-button' />
</button>
</div>
</div>