fix sticky toolbar width
This commit is contained in:
parent
a1a693051c
commit
5d839e8410
@ -68,7 +68,10 @@ class EntryEditor extends Component {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const editor = (
|
const editor = (
|
||||||
<StickyContext className={classnames(styles.controlPane, { [styles.blocker]: showEventBlocker })}>
|
<StickyContext
|
||||||
|
className={classnames(styles.controlPane, { [styles.blocker]: showEventBlocker })}
|
||||||
|
registerListener={fn => this.updateStickyContext = fn}
|
||||||
|
>
|
||||||
{ collectionPreviewEnabled ? togglePreviewButton : null }
|
{ collectionPreviewEnabled ? togglePreviewButton : null }
|
||||||
<ControlPane
|
<ControlPane
|
||||||
collection={collection}
|
collection={collection}
|
||||||
@ -93,6 +96,7 @@ class EntryEditor extends Component {
|
|||||||
defaultSize="50%"
|
defaultSize="50%"
|
||||||
onDragStarted={this.handleSplitPaneDragStart}
|
onDragStarted={this.handleSplitPaneDragStart}
|
||||||
onDragFinished={this.handleSplitPaneDragFinished}
|
onDragFinished={this.handleSplitPaneDragFinished}
|
||||||
|
onChange={this.updateStickyContext}
|
||||||
>
|
>
|
||||||
<ScrollSyncPane>{editor}</ScrollSyncPane>
|
<ScrollSyncPane>{editor}</ScrollSyncPane>
|
||||||
<div className={classnames(styles.previewPane, { [styles.blocker]: showEventBlocker })}>
|
<div className={classnames(styles.previewPane, { [styles.blocker]: showEventBlocker })}>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.sticky {
|
.sticky {
|
||||||
position: relative !important;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stickyActive:not(.stickyAtBottom) {
|
.stickyActive:not(.stickyAtBottom) {
|
||||||
|
@ -34,6 +34,7 @@ export class StickyContext extends Component {
|
|||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.updateStickies(this.ref);
|
this.updateStickies(this.ref);
|
||||||
|
this.props.registerListener(this.updateStickies.bind(this, this.ref));
|
||||||
}
|
}
|
||||||
|
|
||||||
handleScroll = (event) => {
|
handleScroll = (event) => {
|
||||||
@ -144,7 +145,11 @@ export class Sticky extends Component {
|
|||||||
[styles.stickyAtBottom]: state.shouldStickAtBottom,
|
[styles.stickyAtBottom]: state.shouldStickAtBottom,
|
||||||
},
|
},
|
||||||
)}
|
)}
|
||||||
style={props.fillContainerWidth && state.containerWidth ? { width: state.containerWidth } : null}
|
style={
|
||||||
|
props.fillContainerWidth && state.containerWidth && state.shouldStick ?
|
||||||
|
{ width: state.containerWidth } :
|
||||||
|
null
|
||||||
|
}
|
||||||
ref={(ref) => {this.ref = ref}}
|
ref={(ref) => {this.ref = ref}}
|
||||||
>
|
>
|
||||||
{props.children}
|
{props.children}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user