Action link role sets to `button` if no HREF is given

This commit is contained in:
kushalpandya 2017-05-31 20:25:57 +05:30 committed by Jarka Kadlecova
parent 73af7178a5
commit 112d540df4
1 changed files with 8 additions and 2 deletions

View File

@ -45,11 +45,17 @@ window.Flash = (function() {
textDiv.appendTo(flash);
if (actionConfig) {
actionLink = $('<a/>', {
const actionLinkConfig = {
class: 'flash-action',
href: actionConfig.href || '#',
text: actionConfig.title
});
};
if (!actionConfig.href) {
actionLinkConfig.role = 'button';
}
actionLink = $('<a/>', actionLinkConfig);
actionLink.appendTo(flash);
this.flashContainer.on('click', '.flash-action', actionConfig.clickHandler);