Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/iNavFlight/inav-configurator.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Lines <darren@darrenlines.uk>2022-02-19 22:59:26 +0300
committerDarren Lines <darren@darrenlines.uk>2022-02-19 22:59:26 +0300
commitf9a5eca69f89cfde5edc5a162c2c3202e1cb1b08 (patch)
tree17ed3d43d17d96deab2b1b57594f70298a0cff7f /main.js
parent0f27abf733ef260f084b9ee5de9f1b63deecd8ed (diff)
Made highlighting switchable via the config gear
Diffstat (limited to 'main.js')
-rw-r--r--main.js33
1 files changed, 31 insertions, 2 deletions
diff --git a/main.js b/main.js
index 09407d5f..3d719944 100644
--- a/main.js
+++ b/main.js
@@ -28,7 +28,8 @@ let globalSettings = {
mapProviderType: null,
mapApiKey: null,
proxyURL: null,
- proxyLayer: null
+ proxyLayer: null,
+ showProfileParameters: null,
};
$(document).ready(function () {
@@ -65,6 +66,12 @@ $(document).ready(function () {
}
globalSettings.proxyLayer = result.proxylayer;
});
+ chrome.storage.local.get('show_profile_parameters', function (result) {
+ if (typeof result.show_profile_parameters === 'undefined') {
+ result.show_profile_parameters = 1;
+ }
+ globalSettings.showProfileParameters = result.show_profile_parameters;
+ });
// Resets the OSD units used by the unit coversion when the FC is disconnected.
if (!CONFIGURATOR.connectionValid) {
@@ -327,11 +334,33 @@ $(document).ready(function () {
googleAnalyticsConfig.setTrackingPermitted(check);
});
+ $('div.show_profile_parameters input').change(function () {
+ globalSettings.showProfileParameters = $(this).is(':checked');
+ chrome.storage.local.set({
+ 'show_profile_parameters': globalSettings.showProfileParameters
+ });
+
+ // Update CSS on select boxes
+ if (globalSettings.showProfileParameters) {
+ $('.dropdown-dark #profilechange').addClass('showProfileParams');
+ $('.dropdown-dark #batteryprofilechange').addClass('showProfileParams');
+ } else {
+ $('.dropdown-dark #profilechange').removeClass('showProfileParams');
+ $('.dropdown-dark #batteryprofilechange').removeClass('showProfileParams');
+ }
+
+ // Horrible way to reload the tab
+ const activeTab = $('#tabs li.active');
+ activeTab.removeClass('active');
+ activeTab.find('a').click();
+ });
+
$('#ui-unit-type').val(globalSettings.unitType);
$('#map-provider-type').val(globalSettings.mapProviderType);
$('#map-api-key').val(globalSettings.mapApiKey);
$('#proxyurl').val(globalSettings.proxyURL);
- $('#proxylayer').val(globalSettings.proxyLayer);
+ $('#proxylayer').val(globalSettings.proxyLayer);
+ $('#showProfileParameters').prop('checked', globalSettings.showProfileParameters);
// Set the value of the unit type
// none, OSD, imperial, metric