1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +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

@@ -48,7 +48,15 @@ class SnippetNoteDetail extends React.Component {
description: ''
}, props.note, {
snippets: props.note.snippets.map((snippet) => Object.assign({}, snippet))
})
}),
fullScreen: {
status: false,
oldState: {
nd : 0,
mb : 0
}
}
}
}
@@ -190,6 +198,34 @@ class SnippetNoteDetail 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'
}
}
handleTabPlusButtonClick (e) {
this.addSnippet()
}
@@ -527,6 +563,11 @@ class SnippetNoteDetail 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>