remove selection capabilities from embed

main
Mike Fix 5 years ago
parent f58b7e9ccd
commit 3ed6405811

@ -75,6 +75,10 @@ class Carbon extends React.PureComponent {
} }
onSelection = (ed, data) => { onSelection = (ed, data) => {
if (this.props.readOnly) {
return
}
const selection = data.ranges[0] const selection = data.ranges[0]
if ( if (
selection.head.line === selection.anchor.line && selection.head.line === selection.anchor.line &&
@ -313,7 +317,7 @@ class Carbon extends React.PureComponent {
<SpinnerWrapper loading={this.props.loading}>{content}</SpinnerWrapper> <SpinnerWrapper loading={this.props.loading}>{content}</SpinnerWrapper>
<div className="twitter-png-fix" /> <div className="twitter-png-fix" />
</div> </div>
{this.state.selectionAt && ( {!this.props.readOnly && this.state.selectionAt && (
<SelectionEditor position={this.state.selectionAt} onChange={this.onSelectionChange} /> <SelectionEditor position={this.state.selectionAt} onChange={this.onSelectionChange} />
)} )}
<style jsx> <style jsx>

Loading…
Cancel
Save