Skip to content

feat(src): add support for closeIcon without closeLabel #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tingle.css
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@
vertical-align: middle;
font-size: 1.6rem;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
margin-left: .8rem;
}

.tingle-modal__closeIcon {
display: inline-block;
margin-right: .8rem;
width: 1.6rem;
vertical-align: middle;
font-size: 0;
Expand Down
14 changes: 9 additions & 5 deletions src/tingle.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,16 @@
this.modalCloseBtnIcon.classList.add('tingle-modal__closeIcon')
this.modalCloseBtnIcon.innerHTML = closeIcon()

this.modalCloseBtnLabel = document.createElement('span')
this.modalCloseBtnLabel.classList.add('tingle-modal__closeLabel')
this.modalCloseBtnLabel.innerHTML = this.opts.closeLabel

this.modalCloseBtn.appendChild(this.modalCloseBtnIcon)
this.modalCloseBtn.appendChild(this.modalCloseBtnLabel)

if (this.opts.closeLabel !== '') {
this.modalCloseBtnLabel = document.createElement('span')
this.modalCloseBtnLabel.classList.add('tingle-modal__closeLabel')
this.modalCloseBtnLabel.innerHTML = this.opts.closeLabel

this.modalCloseBtn.appendChild(this.modalCloseBtnLabel)
}

}

// modal
Expand Down