Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2017-04-24 22:55:46 +0300
committerJacob Schatz <jschatz@gitlab.com>2017-04-24 22:55:46 +0300
commit22c88c675df13d918be1f4f681dbca47cb263bcb (patch)
tree3c8fc59deead757cb083d38a566ee56f40b3a4f6 /app
parent375746d6fc308dc16875750bc9342196166d28a6 (diff)
parentf0a164a6d58fe8fe1711a7afbd698a5c2b546a1e (diff)
Merge branch 'add-aria-to-icon' into 'master'
Add aria to icon See merge request !10670
Diffstat (limited to 'app')
-rw-r--r--app/helpers/icons_helper.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb
index ab3ef454e1c..55fa81e95ef 100644
--- a/app/helpers/icons_helper.rb
+++ b/app/helpers/icons_helper.rb
@@ -7,6 +7,11 @@ module IconsHelper
# font-awesome-rails gem, but should we ever use a different icon pack in the
# future we won't have to change hundreds of method calls.
def icon(names, options = {})
+ if (options.keys & %w[aria-hidden aria-label]).empty?
+ # Add `aria-hidden` if there are no aria's set
+ options['aria-hidden'] = true
+ end
+
options.include?(:base) ? fa_stacked_icon(names, options) : fa_icon(names, options)
end