mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-23 16:25:19 +03:00
Remove Autoconnect
This commit is contained in:
parent
7bc94e130a
commit
b5db21ae7c
5 changed files with 1 additions and 64 deletions
|
@ -153,9 +153,7 @@ $(document).ready(function () {
|
|||
|
||||
// unlock port select & baud
|
||||
$port.prop('disabled', false);
|
||||
if (!GUI.auto_connect) {
|
||||
$baud.prop('disabled', false);
|
||||
}
|
||||
$baud.prop('disabled', false);
|
||||
|
||||
// reset connect / disconnect button
|
||||
$('div.connect_controls a.connect').removeClass('active');
|
||||
|
@ -177,45 +175,6 @@ $(document).ready(function () {
|
|||
}
|
||||
});
|
||||
|
||||
// auto-connect
|
||||
chrome.storage.local.get('auto_connect', function (result) {
|
||||
if (result.auto_connect === 'undefined' || result.auto_connect) {
|
||||
// default or enabled by user
|
||||
GUI.auto_connect = true;
|
||||
|
||||
$('input.auto_connect').prop('checked', true);
|
||||
$('input.auto_connect, span.auto_connect').prop('title', chrome.i18n.getMessage('autoConnectEnabled'));
|
||||
|
||||
$baud.val(115200).prop('disabled', true);
|
||||
} else {
|
||||
// disabled by user
|
||||
GUI.auto_connect = false;
|
||||
|
||||
$('input.auto_connect').prop('checked', false);
|
||||
$('input.auto_connect, span.auto_connect').prop('title', chrome.i18n.getMessage('autoConnectDisabled'));
|
||||
}
|
||||
|
||||
// bind UI hook to auto-connect checkbos
|
||||
$('input.auto_connect').change(function () {
|
||||
GUI.auto_connect = $(this).is(':checked');
|
||||
|
||||
// update title/tooltip
|
||||
if (GUI.auto_connect) {
|
||||
$('input.auto_connect, span.auto_connect').prop('title', chrome.i18n.getMessage('autoConnectEnabled'));
|
||||
|
||||
$baud.val(115200).prop('disabled', true);
|
||||
} else {
|
||||
$('input.auto_connect, span.auto_connect').prop('title', chrome.i18n.getMessage('autoConnectDisabled'));
|
||||
|
||||
if (!GUI.connected_to && !GUI.connecting_to) $('select#baud').prop('disabled', false);
|
||||
}
|
||||
|
||||
chrome.storage.local.set({'auto_connect': GUI.auto_connect});
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
PortHandler.initialize();
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue