mirror of
https://github.com/maputnik/editor.git
synced 2025-12-26 16:10:01 +00:00
Scroll container component
This commit is contained in:
@@ -17,6 +17,8 @@ import MdVisibilityOff from 'react-icons/lib/md/visibility-off'
|
||||
import MdDelete from 'react-icons/lib/md/delete'
|
||||
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
||||
|
||||
import ScrollContainer from '../scrollcontainer.jsx'
|
||||
|
||||
class UnsupportedLayer extends React.Component {
|
||||
render() {
|
||||
return <div></div>
|
||||
@@ -141,9 +143,11 @@ export class LayerEditor extends React.Component {
|
||||
<MdDelete />
|
||||
</NavItem>
|
||||
</Toolbar>
|
||||
<div style={{padding: theme.scale[2], paddingRight: 0, backgroundColor: theme.colors.black}}>
|
||||
{this.layerFromType(this.props.layer.get('type'))}
|
||||
</div>
|
||||
<ScrollContainer>
|
||||
<div style={{padding: theme.scale[2], paddingRight: 0, backgroundColor: theme.colors.black}}>
|
||||
{this.layerFromType(this.props.layer.get('type'))}
|
||||
</div>
|
||||
</ScrollContainer>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ import Space from 'rebass/dist/Space'
|
||||
|
||||
import { LayerEditor } from './editor.jsx'
|
||||
import LayerListItem from './listitem.jsx'
|
||||
import scrollbars from '../scrollbars.scss'
|
||||
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
||||
import theme from '../theme.js'
|
||||
import ScrollContainer from '../scrollcontainer.jsx'
|
||||
|
||||
import {SortableContainer, SortableHandle, arrayMove} from 'react-sortable-hoc';
|
||||
|
||||
@@ -53,17 +53,11 @@ class LayerListContainer extends React.Component {
|
||||
onLayerSelected={this.props.onLayerSelected}
|
||||
/>
|
||||
})
|
||||
return <ul className={scrollbars.darkScrollbar} style={{
|
||||
overflowY: "scroll",
|
||||
bottom:0,
|
||||
left:0,
|
||||
right:0,
|
||||
top:1,
|
||||
position: "absolute",
|
||||
padding: theme.scale[2],
|
||||
}}>
|
||||
{layerPanels}
|
||||
</ul>
|
||||
return <ScrollContainer>
|
||||
<ul style={{ padding: theme.scale[2] }}>
|
||||
{layerPanels}
|
||||
</ul>
|
||||
</ScrollContainer>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
19
src/scrollcontainer.jsx
Normal file
19
src/scrollcontainer.jsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import React from 'react'
|
||||
import theme from './theme.js'
|
||||
import scrollbars from './scrollbars.scss'
|
||||
|
||||
const ScrollContainer = (props) => {
|
||||
return <div className={scrollbars.darkScrollbar} style={{
|
||||
overflowY: "scroll",
|
||||
bottom:0,
|
||||
left:0,
|
||||
right:0,
|
||||
top:1,
|
||||
position: "absolute",
|
||||
padding: theme.scale[2],
|
||||
}}>
|
||||
{props.children}
|
||||
</div>
|
||||
}
|
||||
|
||||
export default ScrollContainer
|
||||
Reference in New Issue
Block a user