File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,8 +94,15 @@ export class EmbeddedEcard {
9494 return iframe ;
9595 }
9696 addEventListeners ( ) {
97+ var _a ;
98+ const inMemoriamCheckbox = document . getElementById ( "en__field_transaction_inmem" ) ;
9799 const sendEcardCheckbox = document . getElementById ( "en__field_embedded-ecard" ) ;
98- this . toggleEcardForm ( sendEcardCheckbox . checked ) ;
100+ this . toggleEcardForm ( ( ( _a = inMemoriamCheckbox === null || inMemoriamCheckbox === void 0 ? void 0 : inMemoriamCheckbox . checked ) !== null && _a !== void 0 ? _a : true ) && sendEcardCheckbox . checked ) ;
101+ inMemoriamCheckbox === null || inMemoriamCheckbox === void 0 ? void 0 : inMemoriamCheckbox . addEventListener ( "change" , ( e ) => {
102+ const checkbox = e . target ;
103+ const _sendEcardCheckbox = document . getElementById ( "en__field_embedded-ecard" ) ;
104+ this . toggleEcardForm ( checkbox . checked && _sendEcardCheckbox . checked ) ;
105+ } ) ;
99106 sendEcardCheckbox === null || sendEcardCheckbox === void 0 ? void 0 : sendEcardCheckbox . addEventListener ( "change" , ( e ) => {
100107 const checkbox = e . target ;
101108 this . toggleEcardForm ( checkbox . checked ) ;
Original file line number Diff line number Diff line change @@ -141,12 +141,20 @@ export class EmbeddedEcard {
141141 }
142142
143143 private addEventListeners ( ) {
144+ const inMemoriamCheckbox = document . getElementById (
145+ "en__field_transaction_inmem"
146+ ) as HTMLInputElement ;
144147 const sendEcardCheckbox = document . getElementById (
145148 "en__field_embedded-ecard"
146149 ) as HTMLInputElement ;
147150
148- this . toggleEcardForm ( sendEcardCheckbox . checked ) ;
151+ this . toggleEcardForm ( ( inMemoriamCheckbox ?. checked ?? true ) && sendEcardCheckbox . checked ) ;
149152
153+ inMemoriamCheckbox ?. addEventListener ( "change" , ( e ) => {
154+ const checkbox = e . target as HTMLInputElement ;
155+ const _sendEcardCheckbox = document . getElementById ( "en__field_embedded-ecard" ) as HTMLInputElement ;
156+ this . toggleEcardForm ( checkbox . checked && _sendEcardCheckbox . checked ) ;
157+ } ) ;
150158 sendEcardCheckbox ?. addEventListener ( "change" , ( e ) => {
151159 const checkbox = e . target as HTMLInputElement ;
152160 this . toggleEcardForm ( checkbox . checked ) ;
You can’t perform that action at this time.
0 commit comments