mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
lint colorpicker code
This commit is contained in:
@@ -58,7 +58,7 @@ class UnstyledFolderItem extends React.Component {
|
|||||||
this.setState({ folder }, function () {
|
this.setState({ folder }, function () {
|
||||||
// After the color picker has been painted, re-calculate its position
|
// After the color picker has been painted, re-calculate its position
|
||||||
// by comparing its dimensions to the host dimensions.
|
// by comparing its dimensions to the host dimensions.
|
||||||
const { hostBoundingBox } = this.props;
|
const { hostBoundingBox } = this.props
|
||||||
const colorPickerNode = ReactDOM.findDOMNode(this.refs.colorPicker)
|
const colorPickerNode = ReactDOM.findDOMNode(this.refs.colorPicker)
|
||||||
const colorPickerBox = colorPickerNode.getBoundingClientRect()
|
const colorPickerBox = colorPickerNode.getBoundingClientRect()
|
||||||
const offsetTop = hostBoundingBox.bottom - colorPickerBox.bottom
|
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}}
|
<button styleName='folderList-item-left-colorButton' style={{color: this.state.folder.color}}
|
||||||
onClick={(e) => !this.state.folder.showColumnPicker && this.handleColorButtonClick(e)}
|
onClick={(e) => !this.state.folder.showColumnPicker && this.handleColorButtonClick(e)}
|
||||||
>
|
>
|
||||||
{ this.state.folder.showColumnPicker ?
|
{this.state.folder.showColumnPicker
|
||||||
<div style={ popover }>
|
? <div style={popover}>
|
||||||
<div style={cover}
|
<div style={cover}
|
||||||
onClick={ () => this.handleColorPickerClose() } />
|
onClick={() => this.handleColorPickerClose()}
|
||||||
|
/>
|
||||||
<div style={pickerStyle}>
|
<div style={pickerStyle}>
|
||||||
<SketchPicker
|
<SketchPicker
|
||||||
ref="colorPicker"
|
ref='colorPicker'
|
||||||
color={this.state.folder.color}
|
color={this.state.folder.color}
|
||||||
onChange={(color) => this.handleColorChange(color)}
|
onChange={(color) => this.handleColorChange(color)}
|
||||||
onChangeComplete={ (color) => this.handleColorChange(color) } />
|
onChangeComplete={(color) => this.handleColorChange(color)}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
: null }
|
: null
|
||||||
|
}
|
||||||
<i className='fa fa-square'/>
|
<i className='fa fa-square'/>
|
||||||
</button>
|
</button>
|
||||||
<input styleName='folderList-item-left-nameInput'
|
<input styleName='folderList-item-left-nameInput'
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ class Preferences extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderContent () {
|
renderContent () {
|
||||||
const { boundingBox } = this.state;
|
const { boundingBox } = this.state
|
||||||
let { dispatch, config, storages } = this.props
|
let { dispatch, config, data } = this.props
|
||||||
|
|
||||||
switch (this.state.currentTab) {
|
switch (this.state.currentTab) {
|
||||||
case 'INFO':
|
case 'INFO':
|
||||||
@@ -51,7 +51,7 @@ class Preferences extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<StoragesTab
|
<StoragesTab
|
||||||
dispatch={dispatch}
|
dispatch={dispatch}
|
||||||
storages={storages}
|
data={data}
|
||||||
boundingBox={boundingBox}
|
boundingBox={boundingBox}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
@@ -66,7 +66,7 @@ class Preferences extends React.Component {
|
|||||||
|
|
||||||
getContentBoundingBox () {
|
getContentBoundingBox () {
|
||||||
const node = ReactDOM.findDOMNode(this.refs.content)
|
const node = ReactDOM.findDOMNode(this.refs.content)
|
||||||
return node.getBoundingClientRect();
|
return node.getBoundingClientRect()
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
|||||||
Reference in New Issue
Block a user