Skip to content

Commit

Permalink
feat: pass- any attribute to modal container
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Jun 27, 2022
1 parent 0dc29a3 commit 79bc117
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,12 @@ Modal.prototype = {
if (attributes){
if (attributes['pass_to']) {
iframe.setAttribute('pass_id', attributes['pass_to'].value);
iframe.setAttribute('collection', "");
iframe.setAttribute('document_id', "");
}
if (attributes['pass-name']) {
iframe.setAttribute('name', attributes['pass-name'].value);
}
if (attributes['pass-src']) {
iframe.setAttribute('src', attributes['pass-src'].value);
}
for (let attribute of attributes){
if (attribute.name.startsWith('pass-')){
iframe.setAttribute(`${attribute.name.substring(5)}`, attribute.value);
}
}
}

this.el.appendChild(iframe)
Expand Down

0 comments on commit 79bc117

Please sign in to comment.