1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-26 01:35:28 +03:00

Fix for firmware flasher checkboxes not restoring saved state issue #274.

This commit is contained in:
Kristjan Vaga 2015-11-17 00:53:40 +02:00
parent 4e8fc955b0
commit 168b412089
2 changed files with 52 additions and 47 deletions

View file

@ -239,36 +239,39 @@ GUI_control.prototype.tab_switch_cleanup = function (callback) {
GUI_control.prototype.content_ready = function (callback) { GUI_control.prototype.content_ready = function (callback) {
$('.togglesmall').each(function(index, html) { $('.togglesmall').each(function(index, elem) {
var switchery = new Switchery(html, var switchery = new Switchery(elem, {
{
size: 'small', size: 'small',
color: '#59aa29', color: '#59aa29',
secondaryColor: '#c4c4c4' secondaryColor: '#c4c4c4'
}); });
$(elem).on("change", function (evt) {
$(html).removeClass('togglesmall'); switchery.setPosition();
});
$(elem).removeClass('togglesmall');
}); });
$('.toggle').each(function(index, html) { $('.toggle').each(function(index, elem) {
var switchery = new Switchery(html, var switchery = new Switchery(elem, {
{
color: '#59aa29', color: '#59aa29',
secondaryColor: '#c4c4c4' secondaryColor: '#c4c4c4'
}); });
$(elem).on("change", function (evt) {
$(html).removeClass('toggle'); switchery.setPosition();
});
$(elem).removeClass('toggle');
}); });
$('.togglemedium').each(function(index, html) { $('.togglemedium').each(function(index, elem) {
var switchery = new Switchery(html, var switchery = new Switchery(elem, {
{
className: 'switcherymid', className: 'switcherymid',
color: '#59aa29', color: '#59aa29',
secondaryColor: '#c4c4c4' secondaryColor: '#c4c4c4'
}); });
$(elem).on("change", function (evt) {
$(html).removeClass('togglemedium'); switchery.setPosition();
});
$(elem).removeClass('togglemedium');
}); });
// Build link to in-use CF version documentation // Build link to in-use CF version documentation

View file

@ -424,6 +424,8 @@ TABS.firmware_flasher.initialize = function (callback) {
chrome.storage.local.set({'no_reboot_sequence': status}); chrome.storage.local.set({'no_reboot_sequence': status});
}); });
$('input.updating').change();
}); });
chrome.storage.local.get('flash_manual_baud', function (result) { chrome.storage.local.get('flash_manual_baud', function (result) {
@ -436,7 +438,6 @@ TABS.firmware_flasher.initialize = function (callback) {
// bind UI hook so the status is saved on change // bind UI hook so the status is saved on change
$('input.flash_manual_baud').change(function() { $('input.flash_manual_baud').change(function() {
var status = $(this).is(':checked'); var status = $(this).is(':checked');
chrome.storage.local.set({'flash_manual_baud': status}); chrome.storage.local.set({'flash_manual_baud': status});
}); });
@ -507,6 +508,7 @@ TABS.firmware_flasher.initialize = function (callback) {
$('input.erase_chip').change(function () { $('input.erase_chip').change(function () {
chrome.storage.local.set({'erase_chip': $(this).is(':checked')}); chrome.storage.local.set({'erase_chip': $(this).is(':checked')});
}); });
}); });
$(document).keypress(function (e) { $(document).keypress(function (e) {