Skip to content

Commit

Permalink
removed scroll sync
Browse files Browse the repository at this point in the history
fix #180
  • Loading branch information
Pietro Passarelli - News Labs committed Aug 12, 2019
1 parent 0855005 commit 1fd498e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 44 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@
"react-keyboard-shortcuts": "^1.1.3",
"react-simple-tooltip": "^2.3.3",
"sbd": "^1.0.15",
"smpte-timecode": "^1.2.3",
"react-visibility-sensor": "^5.1.1"
"smpte-timecode": "^1.2.3"
},
"peerDependencies": {
"react": "^16.6.0",
Expand Down
52 changes: 10 additions & 42 deletions packages/components/timed-text-editor/WrapperBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
} from '../../util/timecode-converter';

import style from './WrapperBlock.module.css';
import VisibilitySensor from 'react-visibility-sensor';

class WrapperBlock extends React.Component {
constructor(props) {
Expand Down Expand Up @@ -138,48 +137,17 @@ class WrapperBlock extends React.Component {

return (
<div className={ style.WrapperBlock }>

<VisibilitySensor
partialVisibility={ true }
// intervalCheck={ false }
scrollCheck
<div
className={ [ style.markers, style.unselectable ].join(' ') }
contentEditable={ false }
>
{
({ isVisible }) => (
<>
{isVisible ? (
<>
<div
className={ [ style.markers, style.unselectable ].join(' ') }
contentEditable={ false }
>
{this.props.blockProps.showSpeakers ? speakerElement : ''}

{this.props.blockProps.showTimecodes ? timecodeElement : ''}
</div>
<div className={ style.text }>
<EditorBlock { ...this.props } />
</div>
</>
) : (
<>
<div
className={ [ style.markers, style.unselectable ].join(' ') }
contentEditable={ false }
>
<span className={ style.speaker }></span>
<span className={ style.time } ></span>
</div>
<div className={ style.text }>
<span></span>
</div>
</>
)}
</>
)

}
</VisibilitySensor>
{this.props.blockProps.showSpeakers ? speakerElement : ''}

{this.props.blockProps.showTimecodes ? timecodeElement : ''}
</div>
<div className={ style.text }>
<EditorBlock { ...this.props } />
</div>
</div>
);
}
Expand Down

0 comments on commit 1fd498e

Please sign in to comment.