Clear the changed environment display if the user cancels out of modal

This commit is contained in:
Montana 2018-09-20 09:31:47 -04:00
parent bf605d1ce6
commit b973d3cf45
2 changed files with 10 additions and 8 deletions

View File

@ -18,12 +18,13 @@ export default {
props: {
choices: Array,
initialData: String
initialData: String,
},
data: function () {
return { value: this.initialData }
return {
value: this.initialData,
}
},
methods: {
@ -33,9 +34,10 @@ export default {
readableName: function (role) {
return role.replace(/[_]/g, " ")
},
cancel: function (current_role, selected_role) {
if (current_role != selected_role) {
this.value = current_role
}
}
},
mounted: function () {
console.log(this.initialData, this.choices)
}
}

View File

@ -117,7 +117,7 @@
<div class='block-list__footer'>
<div class='action-group'>
<a v-on:click="closeModal('{{ env.name }}RolesModal')" class='action-group__action usa-button'>Select Access Role</a>
<a class='action-group__action icon-link icon-link--danger' v-on:click="closeModal('{{ env.name }}RolesModal')">Cancel</a>
<a class='action-group__action icon-link icon-link--danger' v-on:click="closeModal('{{ env.name }}RolesModal'); cancel('{{ role }}', value);" value="{{ value if value == role else role }}" >Cancel</a>
</div>
</div>
</div>