1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-24 00:35:20 +03:00

crude port

This commit is contained in:
Pawel Spychalski (DzikuVx) 2016-11-22 23:14:04 +01:00
parent 706cb4c36f
commit 25c8a6f61c
15 changed files with 50864 additions and 4 deletions

View file

@ -1,3 +1,4 @@
/*global $*/
'use strict';
var TABS = {}; // filled by individual tab js file
@ -35,7 +36,8 @@ var GUI_control = function () {
'receiver',
'sensors',
'servos',
'setup'
'setup',
'osd'
];
this.allowedTabs = this.defaultAllowedTabsWhenDisconnected;
@ -239,6 +241,44 @@ GUI_control.prototype.tab_switch_cleanup = function (callback) {
}
};
GUI_control.prototype.switchery = function() {
$('.togglesmall').each(function(index, elem) {
var switchery = new Switchery(elem, {
size: 'small',
color: '#ffbb00',
secondaryColor: '#c4c4c4'
});
$(elem).on("change", function (evt) {
switchery.setPosition();
});
$(elem).removeClass('togglesmall');
});
$('.toggle').each(function(index, elem) {
var switchery = new Switchery(elem, {
color: '#ffbb00',
secondaryColor: '#c4c4c4'
});
$(elem).on("change", function (evt) {
switchery.setPosition();
});
$(elem).removeClass('toggle');
});
$('.togglemedium').each(function(index, elem) {
var switchery = new Switchery(elem, {
className: 'switcherymid',
color: '#ffbb00',
secondaryColor: '#c4c4c4'
});
$(elem).on("change", function (evt) {
switchery.setPosition();
});
$(elem).removeClass('togglemedium');
});
};
GUI_control.prototype.content_ready = function (callback) {
$('.togglesmall').each(function(index, elem) {
@ -303,7 +343,7 @@ GUI_control.prototype.content_ready = function (callback) {
});
if (callback) callback();
}
};
// initialize object into GUI variable
var GUI = new GUI_control();