File tree Expand file tree Collapse file tree
assets/stylesheets/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 190190
191191.tutorial-video-modal {
192192 position : fixed ;
193- top : 50% ;
194- left : 50% ;
195- transform : translate (-50% , -50% );
193+ inset : 0 ;
194+ z-index : 100 ;
195+ display : none ;
196+ align-items : center ;
197+ justify-content : center ;
198+ width : 100% ;
199+ height : 100% ;
196200 margin : 0 ;
197- padding : 0 ;
198- padding-top : 50px ;
201+ padding : 40px ;
199202 border : none ;
200- border-radius : var (--border-radius );
201- width : calc (100vw - 80px );
202- max-width : 1200px ;
203- max-height : calc (100vh - 80px );
204203 background : transparent ;
205204 box-shadow : none ;
206205 overflow : visible ;
207206
207+ & [open ] {
208+ display : flex ;
209+ }
210+
208211 & ::backdrop {
209212 background : rgb (0 0 0 / 0.8 );
210213 }
213216 position : relative ;
214217 display : flex ;
215218 flex-direction : column ;
216- width : 100% ;
217- height : 100% ;
219+ width : min ( 1200 px , 100% ) ;
220+ max- height : 100% ;
218221 }
219222
220223 & __close {
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ export default class extends Controller {
1313
1414 const videoUrl = event . params . videoUrl ;
1515 if ( videoUrl ) {
16- this . iframeTarget . onload = ( ) => this . subscribeToVimeoEvents ( ) ;
1716 this . iframeTarget . src = videoUrl ;
1817 }
1918
@@ -60,7 +59,9 @@ export default class extends Controller {
6059 try {
6160 const data =
6261 typeof event . data === "string" ? JSON . parse ( event . data ) : event . data ;
63- if ( data . event === "play" ) {
62+ if ( data . event === "ready" ) {
63+ this . subscribeToVimeoEvents ( ) ;
64+ } else if ( data . event === "play" ) {
6465 this . markComplete ( ) ;
6566 }
6667 } catch ( e ) {
You can’t perform that action at this time.
0 commit comments