Skip to content

Commit

Permalink
reset activations on DT link
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan-Peter Voigt committed Nov 7, 2024
1 parent 4730cd5 commit 830330b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/FacsimileComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export default {
label: 'Add shape to current DiploTrans element',
action: () => {
console.log('add shape to current DiploTrans element ...')
// TODO: ask for function (stem/head/etc)
const baseMessage = 'add shape to DT at '
const filePath = this.$store.getters.currentWritingZoneObject?.diploTrans
const id = this.$store.getters.activeDiploTransElementId
Expand Down
4 changes: 3 additions & 1 deletion src/store/data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1528,7 +1528,9 @@ const dataModule = {
dispatch('loadDocumentIntoStore', { path: atPath, dom: atDoc })
dispatch('logChange', { path: atPath, baseMessage, param, xmlIDs: [annotElemRef.id], isNewDocument: false })

dispatch('setActiveDiploTransElementId', diplomaticElement.getAttribute('xml:id'))
await dispatch('setActiveDiploTransElementId', diplomaticElement.getAttribute('xml:id'))
// TODO: clear activations?
dispatch('diploTransClear')
},

/**
Expand Down
9 changes: 9 additions & 0 deletions src/store/gui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,11 @@ const guiModule = {
}
},

CLEAR_DIPLO_TRANS_ITEMS (state) {
state.diploTransActivations.shapes = new Map()
state.diploTransActivations.annotTrans = new Map()
},

/**
* sets the ID of the selected item from the diplomatic transcription
* @param {[type]} state [description]
Expand Down Expand Up @@ -712,6 +717,10 @@ const guiModule = {
}
},

diploTransClear ({ commit }) {
commit('CLEAR_DIPLO_TRANS_ITEMS')
},

/**
* select WritingZone for shape in facsimile
* @param {string} type type of group
Expand Down

0 comments on commit 830330b

Please sign in to comment.