diff options
author | Camil Staps | 2016-09-05 23:43:35 +0200 |
---|---|---|
committer | Camil Staps | 2016-09-05 23:43:35 +0200 |
commit | 15b26b8b2af028ea30dc34f78ed5c6f3fcb0d547 (patch) | |
tree | e13decabbbe1f50553ea75cdeb50b5bc1496b9a8 /public/js/alerts.js | |
parent | Vote on verb suggestions (diff) |
Suggest new verbs
Diffstat (limited to 'public/js/alerts.js')
-rw-r--r-- | public/js/alerts.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/public/js/alerts.js b/public/js/alerts.js new file mode 100644 index 0000000..c1763ed --- /dev/null +++ b/public/js/alerts.js @@ -0,0 +1,11 @@ +$.fn.addAlert = function (kind, message) { + var box = '<div class="alert alert-' + kind + ' alert-dismissible" role="alert">' + + '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>' + + message + '</div>'; + + $(this).find('.alerts').append($(box)); +} + +$.fn.clearAlerts = function () { + $(this).find('.alerts').html(''); +} |