File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5858 }
5959 }
6060
61+ function requestClose () {
62+ if (upgrading) return ;
63+ onclose? .();
64+ }
65+
6166 function handleKeydown (e ) {
6267 if (e .key === ' Escape' ) {
6368 e .stopPropagation ();
64- onclose ? . ();
69+ requestClose ();
6570 }
6671 }
6772
6873 function handleBackdropClick (e ) {
69- if (e .target === e .currentTarget ) onclose ? . ();
74+ if (e .target === e .currentTarget ) e . stopPropagation ();
7075 }
7176
7277 function formatVersion (v ) {
8186 < div class = " version-dialog" >
8287 < div class = " version-header" >
8388 < h3 id= " version-title" class = " version-title" > CourseCode Version< / h3>
84- < button class = " version-close" onclick= {() => onclose ? .()} title = " Close" >
89+ < button class = " version-close" onclick= {requestClose} title = " Close " disabled = {upgrading} aria - label = " Close" >
8590 < Icon size= {18 }>
8691 < path d= " M18 6 6 18" / >< path d= " m6 6 12 12" / >
8792 < / Icon>
101106 < p class = " restart-hint" > Restart the preview to use the updated framework.< / p>
102107 {/ if }
103108 < div class = " version-actions" >
104- < button class = " btn-primary" onclick= {() => onclose ? .() }> Done< / button>
109+ < button class = " btn-primary" onclick= {requestClose }> Done< / button>
105110 < / div>
106111 < / div>
107112 {: else }
163168 {/ if }
164169
165170 < div class = " version-actions" >
166- < button class = " btn-secondary" onclick= {() => onclose ? .() }>
171+ < button class = " btn-secondary" onclick= {requestClose} disabled = {upgrading }>
167172 {upgradeAvailable ? ' Not Now' : ' Close' }
168173 < / button>
169174 {#if upgradeAvailable}
You can’t perform that action at this time.
0 commit comments