Commit afa4a075e463103cd7148bc97db21421a0718a8a

Authored by Dmitriy Zaporozhets
1 parent e740a00e

Show spinner on network graph while it loading

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
app/helpers/application_helper.rb
@@ -226,8 +226,11 @@ module ApplicationHelper @@ -226,8 +226,11 @@ module ApplicationHelper
226 GitHub::Markup.render(file_name, file_content).html_safe 226 GitHub::Markup.render(file_name, file_content).html_safe
227 end 227 end
228 228
229 - def spinner(text = nil)  
230 - content_tag :div, class: 'loading hide' do 229 + def spinner(text = nil, visible = false)
  230 + css_class = "loading"
  231 + css_class << " hide" unless visible
  232 +
  233 + content_tag :div, class: css_class do
231 content_tag(:i, nil, class: 'icon-spinner icon-spin') + text 234 content_tag(:i, nil, class: 'icon-spinner icon-spin') + text
232 end 235 end
233 end 236 end
app/views/projects/network/show.html.haml
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 .tip 3 .tip
4 You can move around the graph by using the arrow keys. 4 You can move around the graph by using the arrow keys.
5 .network-graph 5 .network-graph
6 - = spinner 6 + = spinner nil, true
7 7
8 :javascript 8 :javascript
9 new Network({ 9 new Network({