Skip to content

Commit

Permalink
Add loading message for blame view
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Palmer committed Oct 14, 2008
1 parent 1c06b21 commit bc85914
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions assets/style.css
Expand Up @@ -182,6 +182,15 @@ pre code {
/*------------------------------------------------------------------------------------
@group blame
------------------------------------------------------------------------------------*/
#loading {
font-size: 120%;
font-family: "Lucida Grande", sans-serif;
color: #000;
display: block;
text-align: center;
font-weight: bold;
}

#blame {
display: block;
}
Expand Down
3 changes: 1 addition & 2 deletions controllers/ApplicationController.rb
Expand Up @@ -166,7 +166,7 @@ def setup_refs_view_menu
heads = heads.sort_by do |head|
name = head.name rescue "temp head"
name == 'master' ? "***" : name
end
end.uniq

add_menu_item = lambda do |refs, menu|
refs.each_with_index do |head, index|
Expand All @@ -187,7 +187,6 @@ def setup_refs_view_menu
add_menu_item.call(repo.tags, @branch_select.menu.itemAtIndex(2)) #tags

current_head = repo.head.name rescue nil
puts "CURRENT HEAD: #{current_head}"
item = @branch_select.itemAtIndex(0).submenu.itemWithTitle(current_head || "master")
@branch_select.cell.setMenuItem(item)
end
Expand Down
2 changes: 2 additions & 0 deletions controllers/TreeController.rb
Expand Up @@ -57,6 +57,7 @@ def item_was_selected(notification)
set_html('title', File.basename(file))
element = doc.getElementById(ELEMENTS[:blame])
element.setInnerHTML("")
element.setInnerHTML('<span id="loading">Loading...</span>')

unless blob.nil?
set_html('hash', blob.id)
Expand Down Expand Up @@ -87,6 +88,7 @@ def item_was_selected(notification)
i += 1
end
end
element.setInnerHTML("")
element.appendChild(blame_list)
else
set_html('hash', 'Untracked or ignored file')
Expand Down

0 comments on commit bc85914

Please sign in to comment.