Employer form mostly working with persist to db
This commit is contained in:
@@ -20,13 +20,18 @@ export default class extends Controller {
|
||||
const nextIndex = this.networkLogoTargets.length
|
||||
const num_of_colors = this.formColorValue.length
|
||||
let colorIndex = 0
|
||||
let newSecondaryColor = "copper"
|
||||
if (nextIndex != 0) {
|
||||
colorIndex = nextIndex % num_of_colors
|
||||
if (nextIndex % 2 == 1) {
|
||||
newSecondaryColor = "bronze"
|
||||
}
|
||||
}
|
||||
const newColor = this.formColorValue[colorIndex]
|
||||
return this.templateTarget.innerHTML
|
||||
.replace(/NEW_RECORD/g, nextIndex)
|
||||
.replace(/NEXT_COLOR/g, newColor)
|
||||
.replace(/NEXT_SECONDARY_COLOR/g, newSecondaryColor)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user