Merge pull request #180 from matthojo/Notification-Dismissal

Notifications can now be dismissed via click / tap
This commit is contained in:
Hannah Wolfe 2013-06-19 14:23:58 -07:00
commit 5cb2f60cc5
3 changed files with 10 additions and 5 deletions

View File

@ -28,6 +28,11 @@
}); });
// Allow notifications to be dismissed
$(document).on('click', '.js-notification .close', function () {
$(this).parent().fadeOut(200, function () { $(this).remove(); });
});
$(document).ready(function () { $(document).ready(function () {
// ## Set interactions for all menus // ## Set interactions for all menus

View File

@ -861,7 +861,7 @@ nav {
}; };
display: inline-block; display: inline-block;
color: rgba(255,255,255,0.6); color: rgba(255,255,255,0.6);
cursor: pointer;
&:hover { color: #fff; } &:hover { color: #fff; }
} }

View File

@ -1,24 +1,24 @@
{{#if messages}} {{#if messages}}
{{#each messages.error}} {{#each messages.error}}
<section class="notification-error"> <section class="notification-error js-notification">
{{.}} {{.}}
<a class="close" href="#"><span class="hidden">Close</span></a> <a class="close" href="#"><span class="hidden">Close</span></a>
</section> </section>
{{/each}} {{/each}}
{{#each messages.success}} {{#each messages.success}}
<section class="notification-success"> <section class="notification-success js-notification">
{{.}} {{.}}
<a class="close" href="#"><span class="hidden">Close</span></a> <a class="close" href="#"><span class="hidden">Close</span></a>
</section> </section>
{{/each}} {{/each}}
{{#each messages.warn}} {{#each messages.warn}}
<section class="notification-alert"> <section class="notification-alert js-notification">
{{.}} {{.}}
<a class="close" href="#"><span class="hidden">Close</span></a> <a class="close" href="#"><span class="hidden">Close</span></a>
</section> </section>
{{/each}} {{/each}}
{{#each messages.info}} {{#each messages.info}}
<section class="notification"> <section class="notification js-notification">
{{.}} {{.}}
<a class="close" href="#"><span class="hidden">Close</span></a> <a class="close" href="#"><span class="hidden">Close</span></a>
</section> </section>