mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Allow old API version to be used but disable LED strip tab and
backup/restore functionality in certain cases. Cleanup of tab switching.
This commit is contained in:
parent
ebbf3de5e1
commit
34b7b87c3e
6 changed files with 86 additions and 43 deletions
|
@ -38,6 +38,12 @@ TABS.setup.initialize = function (callback) {
|
|||
// translate to user-selected language
|
||||
localize();
|
||||
|
||||
if (CONFIG.apiVersion < CONFIGURATOR.backupRestoreMinApiVersionAccepted) {
|
||||
$('#content .backup').addClass('disabled');
|
||||
$('#content .restore').addClass('disabled');
|
||||
|
||||
GUI.log(chrome.i18n.getMessage('initialSetupBackupAndRestoreApiVersion', [CONFIG.apiVersion, CONFIGURATOR.backupRestoreMinApiVersionAccepted]));
|
||||
}
|
||||
// initialize 3D
|
||||
self.initialize3D();
|
||||
|
||||
|
@ -112,6 +118,9 @@ TABS.setup.initialize = function (callback) {
|
|||
});
|
||||
|
||||
$('#content .backup').click(function () {
|
||||
if ($(this).hasClass('disabled')) {
|
||||
return;
|
||||
}
|
||||
configuration_backup(function () {
|
||||
GUI.log(chrome.i18n.getMessage('initialSetupBackupSuccess'));
|
||||
googleAnalytics.sendEvent('Configuration', 'Backup', 'true');
|
||||
|
@ -119,6 +128,9 @@ TABS.setup.initialize = function (callback) {
|
|||
});
|
||||
|
||||
$('#content .restore').click(function () {
|
||||
if ($(this).hasClass('disabled')) {
|
||||
return;
|
||||
}
|
||||
configuration_restore(function () {
|
||||
GUI.log(chrome.i18n.getMessage('initialSetupRestoreSuccess'));
|
||||
googleAnalytics.sendEvent('Configuration', 'Restore', 'true');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue