Commit c1ef4347 authored by kushalpandya's avatar kushalpandya Committed by Jarka Kadlecova

Add support for action links

parent f5f20274
......@@ -7,8 +7,8 @@ window.Flash = (function() {
return $(this).fadeOut();
};
function Flash(message, type, parent) {
var flash, textDiv;
function Flash(message, type, parent, actionConfig) {
var flash, textDiv, actionLink;
if (type == null) {
type = 'alert';
}
......@@ -30,6 +30,17 @@ window.Flash = (function() {
text: message
});
textDiv.appendTo(flash);
if (actionConfig) {
actionLink = $('<a/>', {
"class": "flash-action",
"href": "#",
text: actionConfig.title
});
actionLink.appendTo(flash);
this.flashContainer.on('click', '.flash-action', actionConfig.clickHandler);
}
if (this.flashContainer.parent().hasClass('content-wrapper')) {
textDiv.addClass('container-fluid container-limited');
}
......
......@@ -16,6 +16,22 @@
@extend .alert;
@extend .alert-danger;
margin: 0;
.flash-text,
.flash-action {
display: inline-block;
}
a.flash-action {
margin-left: 5px;
text-decoration: none;
font-weight: normal;
border-bottom: 1px solid;
&:hover {
border-color: transparent;
}
}
}
.flash-notice,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment