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:
parent
a0acd86873
commit
d73196ea11
21 changed files with 49 additions and 47 deletions
30
js/gui.js
30
js/gui.js
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue