|
|
|
@ -23,7 +23,7 @@ export class DriverSelectorModel extends Model {
|
|
|
|
|
}, |
|
|
|
|
customDriver: { |
|
|
|
|
driver: driverSource !== '' ? selectedDriver : '', |
|
|
|
|
text: driverSource !== '' ? `${this.options.driver} (${driverSource})` : '', |
|
|
|
|
value: driverSource !== '' ? `${this.options.driver} (${driverSource})` : '', |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
@ -32,7 +32,8 @@ export class DriverSelectorModel extends Model {
|
|
|
|
|
driverClassItems: () => this.model.customDrivers.map(driver => { |
|
|
|
|
return { |
|
|
|
|
text: `${driver.driverClass} (${driver.name})`, |
|
|
|
|
value: driver.driverClass, |
|
|
|
|
value: `${driver.driverClass} (${driver.name})`, |
|
|
|
|
driverClass: driver.driverClass, |
|
|
|
|
}; |
|
|
|
|
}), |
|
|
|
|
|
|
|
|
@ -57,14 +58,18 @@ export class DriverSelectorModel extends Model {
|
|
|
|
|
this.model.driverSource = ''; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
changeCustomDriver: driver => { |
|
|
|
|
this.model.customDriver.driver = driver; |
|
|
|
|
changeCustomDriver: value => { |
|
|
|
|
|
|
|
|
|
const item = this.model.driverClassItems.find(item => { |
|
|
|
|
return item.value === value; |
|
|
|
|
}); |
|
|
|
|
const driver = item.driverClass; |
|
|
|
|
this.model.customDriver.driver = driver; |
|
|
|
|
|
|
|
|
|
this.model.customDrivers.some(customDriver => { |
|
|
|
|
if (customDriver.driverClass === driver) { |
|
|
|
|
this.model.driverSource = customDriver.name; |
|
|
|
|
this.model.customDriver.text = `${driver} (${customDriver.name})`; |
|
|
|
|
this.model.customDriver.value = `${driver} (${customDriver.name})`; |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|