@@ -227,9 +227,17 @@ motors.initialize = async function (callback) {
227
227
lines . attr ( 'd' , graphHelpers . line ) ;
228
228
}
229
229
230
+ function replace_mixer_preview ( imgSrc ) {
231
+ $ . get ( imgSrc , function ( data ) {
232
+ const svg = $ ( data ) . find ( 'svg' ) ;
233
+ $ ( '.mixerPreview' ) . html ( svg ) ;
234
+ } , 'xml' ) ;
235
+ }
236
+
230
237
function update_model ( mixer ) {
231
238
const imgSrc = getMixerImageSrc ( mixer , FC . MIXER_CONFIG . reverseMotorDir ) ;
232
- $ ( '.mixerPreview img' ) . attr ( 'src' , imgSrc ) ;
239
+
240
+ replace_mixer_preview ( imgSrc ) ;
233
241
234
242
const motorOutputReorderConfig = new MotorOutputReorderConfig ( 100 ) ;
235
243
const domMotorOutputReorderDialogOpen = $ ( '#motorOutputReorderDialogOpen' ) ;
@@ -350,10 +358,8 @@ motors.initialize = async function (callback) {
350
358
mixerListElement . sortSelect ( ) ;
351
359
352
360
function refreshMixerPreview ( ) {
353
- const mixer = FC . MIXER_CONFIG . mixer ;
354
- const reverse = FC . MIXER_CONFIG . reverseMotorDir ? "_reversed" : "" ;
355
-
356
- $ ( '.mixerPreview img' ) . attr ( 'src' , `./resources/motor_order/${ mixerList [ mixer - 1 ] . image } ${ reverse } .svg` ) ;
361
+ const imgSrc = getMixerImageSrc ( FC . MIXER_CONFIG . mixer , FC . MIXER_CONFIG . reverseMotorDir ) ;
362
+ replace_mixer_preview ( imgSrc ) ;
357
363
}
358
364
359
365
const reverseMotorSwitchElement = $ ( '#reverseMotorSwitch' ) ;
0 commit comments