1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 01:21:21 +03:00

Merge pull request #401 from jlmitch5/unique_select2

fixed duplicate choices from being passed to select2
This commit is contained in:
jlmitch5 2015-09-03 15:20:24 -04:00
commit b5881a7c3c

View File

@ -434,6 +434,11 @@ export default
}
data.choices = (scope.type.type === "multiplechoice") ? scope.choices : (scope.type.type === 'multiselect') ? scope.choices : "" ;
if (data.choices !== "") {
// remove duplicates from the choices
data.choices = _.uniq(data.choices.split("\n")).join("\n");
}
Wait('stop');
if(scope.mode === 'add' || scope.mode==="edit" && scope.can_edit === true){
$('#survey-save-button').removeAttr('disabled');