File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 33function UserSettingsDialog ( dialog , onSave ) {
44
55 // Private Variables
6- var that = this ; // generic pointer back to this function
76 var mixerConfiguration = 3 ; // mixerConfiguration starts at 1;
87
98 var customMix = null ;
@@ -65,7 +64,7 @@ function UserSettingsDialog(dialog, onSave) {
6564 return settings ;
6665 }
6766
68- var availableMotors ; // motors that appear in the log file
67+ var availableMotors = [ ] ; // motors that appear in the log file
6968 function getAvailableMotors ( flightLog ) {
7069
7170 var fieldNames = flightLog . getMainFieldNames ( ) ;
@@ -141,10 +140,13 @@ function UserSettingsDialog(dialog, onSave) {
141140
142141 function mixerListSelection ( val ) {
143142
144- if ( val === null ) val = 3 ; // default for invalid values
143+ if ( val == null ) val = 3 ; // default for invalid values
144+
145145 mixerConfiguration = val ;
146146
147- $ ( '.mixerPreview img' ) . attr ( 'src' , './images/motor_order/' + mixerList [ val - 1 ] . image + '.svg' ) ;
147+ if ( val > 0 && val <= mixerList . length ) {
148+ $ ( '.mixerPreview img' ) . attr ( 'src' , './images/motor_order/' + mixerList [ val - 1 ] . image + '.svg' ) ;
149+ }
148150
149151 buildMotorList ( mixerConfiguration ) ; // rebuild the motor list based upon the current selection
150152 }
@@ -195,6 +197,6 @@ function UserSettingsDialog(dialog, onSave) {
195197
196198 dialog . modal ( 'show' ) ;
197199
198- }
200+ } ;
199201
200202}
You can’t perform that action at this time.
0 commit comments