Skip to content

Commit

Permalink
Fix #1247
Browse files Browse the repository at this point in the history
  • Loading branch information
jlpereira committed Jan 9, 2020
1 parent 50e985a commit 22d7499
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Expand Up @@ -63,13 +63,16 @@ export default {
},
methods: {
setTaxon (event) {
this.accept_taxon_name_ids = []
this.taxon = event
},
resetInput () {
this.$refs.inputSearch.reset()
this.$refs.inputSearch.focusInput()
},
editCombination (combination) {
let keys = Object.keys(combination.protonyms)
this.accept_taxon_name_ids = keys.map(key => { return combination.protonyms[key].id })
this.$refs.combination.editCombination(combination.name_string, combination)
this.$refs.inputSearch.disabledButton(true)
},
Expand Down Expand Up @@ -102,7 +105,8 @@ export default {
if (/^\d+$/.test(combinationId)) {
this.loading = true
GetCombination(combinationId).then(response => {
console.log(response)
let keys = Object.keys(response.protonyms)
this.accept_taxon_name_ids = keys.map(key => { return response.protonyms[key].id })
this.editCombination(response)
this.loading = false
}, () => {
Expand Down
Expand Up @@ -151,9 +151,11 @@ export default {
this.expanded = false
} else {
this.rankChoose = newVal.find(item => {
return this.acceptTaxonIds.includes(item.id) || (this.selected && this.selected.id)
return this.acceptTaxonIds.includes(item.id) || (!this.acceptTaxonIds.length && (this.selected && this.selected.id))
})
this.expanded = true
if(!this.rankChoose) {
this.expanded = true
}
}
this.displaySearch = false
}
Expand Down
Expand Up @@ -174,7 +174,6 @@ export default {
this.rankLists = response.data.protonyms
this.parseRanks = response.data.parse
this.searching = false
console.log(response);
this.otherMatches = response.other_matches
this.$nextTick(() => {
if (response.data.unambiguous) {
Expand Down

0 comments on commit 22d7499

Please sign in to comment.