Skip to content
Snippets Groups Projects
Commit c1ef4347 authored by kushalpandya's avatar kushalpandya Committed by Jarka Kadlecova
Browse files

Add support for action links

parent f5f20274
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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';
}
Loading
Loading
@@ -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');
}
Loading
Loading
Loading
Loading
@@ -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,
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment