Skip to content

Commit

Permalink
Fix new object form with citation
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidMStraub committed Jan 5, 2024
1 parent 0b17066 commit c905baa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/components/GrampsjsFormNewEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ export class GrampsjsFormNewEvent extends GrampsjsNewEventMixin(
this.defaultRole = 'Primary'
}

_renderCitationForm() {
return html`
<h4 class="label">${this._('Citation')}</h4>
<grampsjs-form-select-object-list
multiple
id="object-citation"
objectType="citation"
.strings="${this.strings}"
></grampsjs-form-select-object-list>
`
}

renderForm() {
return html`
${super.renderForm()}
Expand Down
6 changes: 6 additions & 0 deletions src/components/GrampsjsObjectForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,12 @@ export class GrampsjsObjectForm extends GrampsjsTranslateMixin(LitElement) {
if (originalTarget.id === 'note-select-list') {
this.data = e.detail
}
if (originalTarget.id === 'object-citation-list') {
this.data = {
...this.data,
citation_list: e.detail.data ?? [],
}
}
if (originalTarget.id === 'citation-select-list') {
this.data = e.detail
}
Expand Down

0 comments on commit c905baa

Please sign in to comment.