1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-16 21:05:30 +03:00

Fix toggle buttons reverting to checkboxes after reboot.

This moves GUI specific code out of main and the individual tab js files
into gui.js, where it fits better.
This commit is contained in:
Dominic Clifton 2015-11-11 21:01:22 +00:00
parent a0acd86873
commit d73196ea11
21 changed files with 49 additions and 47 deletions

View file

@ -237,5 +237,35 @@ GUI_control.prototype.tab_switch_cleanup = function (callback) {
}
};
GUI_control.prototype.content_ready = function (callback) {
$('.togglesmall').each(function(index, html) {
var switchery = new Switchery(html,
{
size: 'small',
color: '#59aa29',
secondaryColor: '#c4c4c4'
});
$(html).removeClass('togglesmall');
});
$('.toggle').each(function(index, html) {
var switchery = new Switchery(html,
{
color: '#59aa29',
secondaryColor: '#c4c4c4'
});
$(html).removeClass('toggle');
});
// Build link to in-use CF version documentation
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
if (callback) callback();
}
// initialize object into GUI variable
var GUI = new GUI_control();