Skip to content

Commit

Permalink
Fix #1007
Browse files Browse the repository at this point in the history
  • Loading branch information
jlpereira committed Jul 12, 2019
1 parent f47d6b4 commit 0861245
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -16,6 +16,8 @@
<div class="content header">
<h3
v-if="taxon.id"
v-shortkey="[getMacKey(), 'p']"
@shortkey="loadParent()"
class="flex-separate middle">
<a
v-shortkey="[getMacKey(), 't']"
Expand Down Expand Up @@ -59,6 +61,7 @@ import DefaultConfidence from 'components/defaultConfidence.vue'
import PinObject from 'components/pin.vue'
import { GetterNames } from '../store/getters/getters'
import { ActionNames } from '../store/actions/actions'
import Modal from 'components/modal.vue'
export default {
Expand Down Expand Up @@ -134,6 +137,14 @@ export default {
},
getMacKey: function () {
return (navigator.platform.indexOf('Mac') > -1 ? 'ctrl' : 'alt')
},
loadParent() {
if(this.taxon.id && this.parent.id) {
this.$store.dispatch(ActionNames.UpdateTaxonName, this.taxon).then((response) => {
console.log(response)
window.open(`/tasks/nomenclature/new_taxon_name?taxon_name_id=${response.parent_id}`, '_self')
})
}
}
}
}
Expand Down

0 comments on commit 0861245

Please sign in to comment.