summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/flash.js
diff options
context:
space:
mode:
authorkushalpandya <kushal@gitlab.com>2017-05-31 20:25:57 +0530
committerJarka Kadlecova <jarka@gitlab.com>2017-06-01 07:47:16 +0200
commit112d540df4a37aeca198dc39e715e04e3655c1f7 (patch)
treecfd0e3d5e3ce1050470d2558e403568e11374719 /app/assets/javascripts/flash.js
parent73af7178a5d5002924603b5688adfaac2d5736eb (diff)
downloadgitlab-ce-112d540df4a37aeca198dc39e715e04e3655c1f7.tar.gz
Action link role sets to `button` if no HREF is given
Diffstat (limited to 'app/assets/javascripts/flash.js')
-rw-r--r--app/assets/javascripts/flash.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/assets/javascripts/flash.js b/app/assets/javascripts/flash.js
index de909946271..ccff8f0ace7 100644
--- a/app/assets/javascripts/flash.js
+++ b/app/assets/javascripts/flash.js
@@ -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);