@@ -8,6 +8,7 @@ let customURLplaceholders = ['github:janedoe/button-mpy',
88] ;
99
1010const statusBar = document . getElementById ( 'status-bar' ) ;
11+ const statusBarCloseButton = document . getElementById ( 'status-bar-close' ) ;
1112const statusMessage = document . getElementById ( 'status-message' ) ;
1213const deviceSelectionList = document . querySelector ( ".item-selection-list" ) ;
1314const reloadDeviceListLink = document . getElementById ( "reload-link" ) ;
@@ -52,6 +53,8 @@ document.addEventListener('DOMContentLoaded', async () => {
5253 setInstallButtonsEnabled ( true ) ;
5354 } ) ;
5455
56+ statusBarCloseButton . addEventListener ( 'click' , hideStatus ) ;
57+
5558 reloadDeviceListLink . addEventListener ( 'click' , async ( ) => {
5659 await reloadDeviceList ( ) ;
5760 } ) ;
@@ -248,6 +251,8 @@ function toggleUserInteraction(enabled) {
248251 searchField . disabled = ! enabled ;
249252 githubUrlInput . disabled = ! enabled ;
250253 manualInstallButton . disabled = ! enabled ;
254+ compileFilesCheckbox . disabled = ! enabled ;
255+ overwriteExistingCheckbox . disabled = ! enabled ;
251256 reloadDeviceListLink . style . pointerEvents = enabled ? 'auto' : 'none' ;
252257 boardItems . forEach ( board => board . style . pointerEvents = enabled ? 'auto' : 'none' ) ;
253258
@@ -335,6 +340,9 @@ function showStatus(message, displayLoader = false, duration = null) {
335340 statusMessage . textContent = message ;
336341 statusBar . classList . remove ( 'hidden' ) ;
337342 statusBarLoadingSpinner . classList . toggle ( 'hidden' , ! displayLoader ) ;
343+
344+ // Hide close button when loader is displayed
345+ statusBarCloseButton . classList . toggle ( 'hidden' , displayLoader ) ;
338346
339347 // Add the visible class to trigger the slide down effect
340348 setTimeout ( ( ) => {
@@ -348,14 +356,12 @@ function showStatus(message, displayLoader = false, duration = null) {
348356}
349357
350358function hideStatus ( ) {
351- const statusBar = document . getElementById ( 'status-bar' ) ;
352-
353359 // Remove the visible class to trigger the slide-up effect
354360 statusBar . classList . remove ( 'visible' ) ;
355361
356362 // After the transition ends, hide the element
357363 setTimeout ( ( ) => {
358- statusBar . style . display = 'none' ;
364+ statusBar . classList . add ( 'hidden' ) ;
359365 } , 500 ) ; // Match this duration with the CSS transition duration
360366}
361367
0 commit comments