-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Launcher save fixed attributes #3784
Changes from 3 commits
0eba218
6df0e0c
f221f5c
a51806e
a38979c
e21b5fb
15e48f4
d90bf55
a2a483b
c464638
e444b4c
485e021
4b2af25
b988ec6
43289e6
27fe98e
91a343b
40d653b
a66184e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,16 +166,38 @@ function addInProgressField(event) { | |
function updateAutoEnvironmentVariable(event) { | ||
var aev_name = event.target.value; | ||
const labelString = event.target.dataset.labelString; | ||
const idString = `launcher_auto_environment_variable_${aev_name}`; | ||
const nameString = `launcher[auto_environment_variable_${aev_name}]`; | ||
var input_field = event.target.parentElement.children[2].children[1]; | ||
|
||
input_field.removeAttribute('readonly'); | ||
input_field.id = `launcher_auto_environment_variable_${aev_name}`; | ||
input_field.name = `launcher[auto_environment_variable_${aev_name}]`; | ||
input_field.id = idString; | ||
input_field.name = nameString; | ||
|
||
if (labelString.match(/Environment( |\s)Variable/)) { | ||
var label_field = event.target.parentElement.children[2].children[0]; | ||
label_field.innerHTML = `Environment Variable: ${aev_name}`; | ||
} | ||
|
||
// Update the checkbox so that environment variables can be fixed when created | ||
let fixedBoxGroup = event.target.parentElement.children[3].children[0].children[0]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like it's really flaky and prone to errors. Is there some ID or data- attribute we can apply here so we don't have this?
|
||
|
||
let checkbox = fixedBoxGroup.children[0]; | ||
checkbox.id = `${idString}_fixed`; | ||
checkbox.name = `launcher[auto_environment_variable_${aev_name}_fixed]`; | ||
checkbox.setAttribute('data-fixed-toggler', idString); | ||
|
||
// Update hidden field if attribute is already fixed, otherwise just update label | ||
let labelIndex = 2; | ||
if(fixedBoxGroup.children.length == 3) { | ||
let hiddenField = fixedBoxGroup.children[1]; | ||
hiddenField.name = nameString; | ||
} else { | ||
labelIndex = 1; | ||
} | ||
|
||
let fixedLabel = fixedBoxGroup.children[labelIndex]; | ||
fixedLabel.setAttribute('for', `${idString}_fixed`); | ||
} | ||
|
||
function fixExcludeBasedOnSelect(selectElement) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you submit the changes to this file in another pull request? I can't just glance at this to see what it is, so I'll need more time to look it over.