1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

lint colorpicker code

This commit is contained in:
Dick Choi
2016-09-01 00:49:25 +09:00
parent 0d573651a3
commit 4ee49d5991
2 changed files with 17 additions and 14 deletions

View File

@@ -55,10 +55,10 @@ class UnstyledFolderItem extends React.Component {
handleColorButtonClick (e) {
const folder = Object.assign({}, this.state.folder, { showColumnPicker: true, colorPickerPos: { left: 0, top: 0 } })
this.setState({ folder }, function() {
this.setState({ folder }, function () {
// After the color picker has been painted, re-calculate its position
// by comparing its dimensions to the host dimensions.
const { hostBoundingBox } = this.props;
const { hostBoundingBox } = this.props
const colorPickerNode = ReactDOM.findDOMNode(this.refs.colorPicker)
const colorPickerBox = colorPickerNode.getBoundingClientRect()
const offsetTop = hostBoundingBox.bottom - colorPickerBox.bottom
@@ -103,19 +103,22 @@ class UnstyledFolderItem extends React.Component {
<button styleName='folderList-item-left-colorButton' style={{color: this.state.folder.color}}
onClick={(e) => !this.state.folder.showColumnPicker && this.handleColorButtonClick(e)}
>
{ this.state.folder.showColumnPicker ?
<div style={ popover }>
<div style={ cover }
onClick={ () => this.handleColorPickerClose() } />
{this.state.folder.showColumnPicker
? <div style={popover}>
<div style={cover}
onClick={() => this.handleColorPickerClose()}
/>
<div style={pickerStyle}>
<SketchPicker
ref="colorPicker"
ref='colorPicker'
color={this.state.folder.color}
onChange={ (color) => this.handleColorChange(color) }
onChangeComplete={ (color) => this.handleColorChange(color) } />
onChange={(color) => this.handleColorChange(color)}
onChangeComplete={(color) => this.handleColorChange(color)}
/>
</div>
</div>
: null }
: null
}
<i className='fa fa-square'/>
</button>
<input styleName='folderList-item-left-nameInput'

View File

@@ -33,8 +33,8 @@ class Preferences extends React.Component {
}
renderContent () {
const { boundingBox } = this.state;
let { dispatch, config, storages } = this.props
const { boundingBox } = this.state
let { dispatch, config, data } = this.props
switch (this.state.currentTab) {
case 'INFO':
@@ -51,7 +51,7 @@ class Preferences extends React.Component {
return (
<StoragesTab
dispatch={dispatch}
storages={storages}
data={data}
boundingBox={boundingBox}
/>
)
@@ -66,7 +66,7 @@ class Preferences extends React.Component {
getContentBoundingBox () {
const node = ReactDOM.findDOMNode(this.refs.content)
return node.getBoundingClientRect();
return node.getBoundingClientRect()
}
render () {