Created
May 14, 2016 04:52
-
-
Save kazzkiq/68382e51c1c0a10e9f71f3919371debb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ac-popup> | |
<div class="popup-overlay" name="popup_overlay"> | |
<div class="popup" name="popup"> | |
<div class="header"> | |
<h1 name="title">{ opts.title }</h1> | |
<h2 if="opts.subtitle">{ opts.subtitle }</h2> | |
<div class="close" onclick="{ closePopup }"></div> | |
</div> | |
<div class="body"> | |
<yield /> | |
</div> | |
</div> | |
</div> | |
<script> | |
this.on('mount', () => { | |
this.popup_overlay.classList.add('come-in'); | |
}); | |
closePopup() { | |
this.popup_overlay.classList.add('come-out'); | |
$(this.popup_overlay).off('animationend'); | |
$(this.popup_overlay).on('animationend', () => { | |
this.unmount(); | |
}); | |
} | |
</script> | |
</ac-popup> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using it declaratively:
Programatically: