Skip to content

Commit

Permalink
Merge branch 'vite-build' of https://github.com/VitroidFPV/betaflight…
Browse files Browse the repository at this point in the history
…-configurator into vite-build
  • Loading branch information
VitroidFPV committed Sep 7, 2023
2 parents e778563 + ce6b281 commit 217e436
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/css/tabs/motors.less
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
border-bottom: 1px solid var(--subtleAccent);
}
.mixerPreview {
img {
svg {
width: 150px;
height: 150px;
margin-left: 15px;
Expand Down
1 change: 1 addition & 0 deletions src/js/port_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const usbDevices = { filters: [
{'vendorId': 1155, 'productId': 57105}, // STM Device in DFU Mode || Digital Radio in USB mode
{'vendorId': 10473, 'productId': 393}, // GD32 DFU Bootloader
{'vendorId': 0x2E3C, 'productId': 0xDF11}, // AT32F435 DFU Bootloader
{'vendorId': 12619, 'productId': 262}, // APM32 DFU Bootloader
] };

const PortHandler = new function () {
Expand Down
16 changes: 11 additions & 5 deletions src/js/tabs/motors.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,17 @@ motors.initialize = async function (callback) {
lines.attr('d', graphHelpers.line);
}

function replace_mixer_preview(imgSrc) {
$.get(imgSrc, function(data) {
const svg = $(data).find('svg');
$('.mixerPreview').html(svg);
}, 'xml');
}

function update_model(mixer) {
const imgSrc = getMixerImageSrc(mixer, FC.MIXER_CONFIG.reverseMotorDir);
$('.mixerPreview img').attr('src', imgSrc);

replace_mixer_preview(imgSrc);

const motorOutputReorderConfig = new MotorOutputReorderConfig(100);
const domMotorOutputReorderDialogOpen = $('#motorOutputReorderDialogOpen');
Expand Down Expand Up @@ -350,10 +358,8 @@ motors.initialize = async function (callback) {
mixerListElement.sortSelect();

function refreshMixerPreview() {
const mixer = FC.MIXER_CONFIG.mixer;
const reverse = FC.MIXER_CONFIG.reverseMotorDir ? "_reversed" : "";

$('.mixerPreview img').attr('src', `./resources/motor_order/${mixerList[mixer - 1].image}${reverse}.svg`);
const imgSrc = getMixerImageSrc(FC.MIXER_CONFIG.mixer, FC.MIXER_CONFIG.reverseMotorDir);
replace_mixer_preview(imgSrc);
}

const reverseMotorSwitchElement = $('#reverseMotorSwitch');
Expand Down

0 comments on commit 217e436

Please sign in to comment.