mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-24 09:46:11 +01:00
Committed Luke's spinner patch: ajax actions show a spinner while they are working, next to the date at the top of the page.
One issue is that adding successive actions without refreshing on the home page only triggers the spinner the first time, but deleting actions on the same page without refreshing triggers it each time. I don't have a clue why. Fixes #192. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@208 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
9e5f0a7c3e
commit
6d4b5f70c0
3 changed files with 12 additions and 1 deletions
|
|
@ -23,7 +23,8 @@
|
|||
<% if @count %>
|
||||
<span id="badge_count" class="badge"><%= @count %></span>
|
||||
<% end %>
|
||||
<%= Time.now.strftime("%A, %d %B %Y") %></h1>
|
||||
<%= Time.now.strftime("%A, %d %B %Y") %> <%= image_tag("spinner.gif", :size => "16X16", :border => 0, :id => 'busy', :style => 'display:none' ) %>
|
||||
</h1>
|
||||
</div>
|
||||
<div id="navcontainer">
|
||||
<ul id="navlist">
|
||||
|
|
|
|||
BIN
tracks/public/images/spinner.gif
Normal file
BIN
tracks/public/images/spinner.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
10
tracks/public/javascripts/application.js
Normal file
10
tracks/public/javascripts/application.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
Ajax.Responders.register({
|
||||
onCreate: function() {
|
||||
if($('busy') && Ajax.activeRequestCount>0)
|
||||
Effect.Appear('busy',{duration:0.5,queue:'end'});
|
||||
},
|
||||
onComplete: function() {
|
||||
if($('busy') && Ajax.activeRequestCount==0)
|
||||
Element.hide('busy');
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue