File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/courseware/course/sequence/Unit/hooks Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -50,19 +50,19 @@ const useIFrameBehavior = ({
5050 if ( type === messageTypes . resize ) {
5151 setIframeHeight ( payload . height ) ;
5252
53- // We observe exit from the video xblock fullscreen mode
54- // and scroll to the previously saved scroll position
55- if ( windowTopOffset !== null ) {
56- window . scrollTo ( 0 , Number ( windowTopOffset ) ) ;
57- }
58-
5953 if ( ! hasLoaded && iframeHeight === 0 && payload . height > 0 ) {
6054 setHasLoaded ( true ) ;
6155 if ( onLoaded ) {
6256 onLoaded ( ) ;
6357 }
6458 }
6559 } else if ( type === messageTypes . videoFullScreen ) {
60+ // We observe exit from the video xblock fullscreen mode
61+ // and scroll to the previously saved scroll position
62+ if ( ! payload . open && windowTopOffset !== null ) {
63+ window . scrollTo ( 0 , Number ( windowTopOffset ) ) ;
64+ }
65+
6666 // We listen for this message from LMS to know when we need to
6767 // save or reset scroll position on toggle video xblock fullscreen mode
6868 setWindowTopOffset ( payload . open ? window . scrollY : null ) ;
You can’t perform that action at this time.
0 commit comments