From a28c3d8635511de7d45776fd42796e7a2547c646 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Mon, 26 Dec 2016 16:33:38 -0500 Subject: [PATCH] make flashes dismissible. --- static/main.css | 5 +++++ static/main.js | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/static/main.css b/static/main.css index 494926e..1769fd3 100644 --- a/static/main.css +++ b/static/main.css @@ -224,6 +224,11 @@ footer ul li:not(:last-child)::after { background-color: rgba(255, 60, 30, 0.2); } +#flashes .dismiss { + float: right; + margin: 0 0 0.5em 0.5em; +} + #character-portrait { position: relative; display: inline-block; diff --git a/static/main.js b/static/main.js index 45be54a..a26ea39 100644 --- a/static/main.js +++ b/static/main.js @@ -14,6 +14,17 @@ $(function() { return false; }); + // Allow user to dismiss flashes: + $("#flashes > div").each(function() { + $(this).prepend($("", { + addClass: "dismiss", + href: "#" + }).html("[×]").click(function() { + $(this).parent().remove(); + return false; + })); + }); + // Toggle character options on click: var charopts = $("#character-options"); charopts.hide();