Disable "Loading firmware [Online]" button when downloading and enable when finish/fail.

10.3.x-maintenance
Rodrigo Pérez 2016-08-02 19:14:27 -04:00
parent da1f4a3b60
commit 4fc1348194
2 changed files with 9 additions and 0 deletions

View File

@ -1478,6 +1478,9 @@
"firmwareFlasherButtonLoadOnline": {
"message": "Load Firmware [Online]"
},
"firmwareFlasherButtonDownloading": {
"message": "Downloading..."
},
"firmwareFlasherFlashFirmware": {
"message": "Flash Firmware"
},

View File

@ -274,12 +274,18 @@ TABS.firmware_flasher.initialize = function (callback) {
function failed_to_load() {
$('span.progressLabel').text(chrome.i18n.getMessage('firmwareFlasherFailedToLoadOnlineFirmware'));
$('a.flash_firmware').addClass('disabled');
$("a.load_remote_file").removeClass('disabled');
$("a.load_remote_file").text(chrome.i18n.getMessage('firmwareFlasherButtonLoadOnline'));
}
var summary = $('select[name="firmware_version"] option:selected').data('summary');
if (summary) { // undefined while list is loading or while running offline
$("a.load_remote_file").text(chrome.i18n.getMessage('firmwareFlasherButtonDownloading'));
$("a.load_remote_file").addClass('disabled');
$.get(summary.url, function (data) {
process_hex(data, summary);
$("a.load_remote_file").removeClass('disabled');
$("a.load_remote_file").text(chrome.i18n.getMessage('firmwareFlasherButtonLoadOnline'));
}).fail(failed_to_load);
} else {
$('span.progressLabel').text(chrome.i18n.getMessage('firmwareFlasherFailedToLoadOnlineFirmware'));