summaryrefslogtreecommitdiff
path: root/app/helpers/icons_helper.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-01-28 03:30:27 -0500
committerRobert Speicher <rspeicher@gmail.com>2015-01-28 03:37:44 -0500
commitfe831dcd6f4af535abba1a9dc350c4d8a0f809e9 (patch)
treed1633e058a956cb91f7d47c7ef6954affec9cfce /app/helpers/icons_helper.rb
parent8633bbc9b852d8809f20db86a3cdfa2cd3b8dd95 (diff)
downloadgitlab-ce-fe831dcd6f4af535abba1a9dc350c4d8a0f809e9.tar.gz
Move `spinner` helper into IconsHelper
Also updates it to use the new `icon` method.
Diffstat (limited to 'app/helpers/icons_helper.rb')
-rw-r--r--app/helpers/icons_helper.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb
index 61c03d90072..18260f0ed4d 100644
--- a/app/helpers/icons_helper.rb
+++ b/app/helpers/icons_helper.rb
@@ -8,6 +8,15 @@ module IconsHelper
fa_icon(names, options)
end
+ def spinner(text = nil, visible = false)
+ css_class = 'loading'
+ css_class << ' hide' unless visible
+
+ content_tag :div, class: css_class do
+ icon('spinner spin') + text
+ end
+ end
+
def boolean_to_icon(value)
if value.to_s == "true"
icon('circle', class: 'cgreen')