@@ -10,6 +10,7 @@ var Commit = function(obj) {
10
10
this . sha = obj . realSha ( ) ;
11
11
this . parents = obj . parents ;
12
12
this . subject = obj . subject ;
13
+ this . notificationID = null ;
13
14
14
15
// TODO:
15
16
// this.author_date instant
@@ -168,11 +169,12 @@ var loadCommit = function(commitObject, currentRef) {
168
169
// Which will be called from the controller once
169
170
// the commit details are in.
170
171
172
+ if ( commit && commit . notificationID )
173
+ clearTimeout ( commit . notificationID ) ;
174
+
171
175
commit = new Commit ( commitObject ) ;
172
176
commit . currentRef = currentRef ;
173
177
174
- notify ( "Loading commit…" , 0 ) ;
175
-
176
178
$ ( "commitID" ) . innerHTML = commit . sha ;
177
179
$ ( "authorID" ) . innerHTML = commit . author_name ;
178
180
$ ( "subjectID" ) . innerHTML = commit . subject . escapeHTML ( ) ;
@@ -202,6 +204,13 @@ var loadCommit = function(commitObject, currentRef) {
202
204
"<a href='' onclick='selectCommit(this.innerHTML); return false;'>" +
203
205
commit . parents [ i ] + "</a></td>" ;
204
206
}
207
+
208
+ commit . notificationID = setTimeout ( function ( ) {
209
+ if ( ! commit . fullyLoaded )
210
+ notify ( "Loading commit…" , 0 ) ;
211
+ commit . notificationID = null ;
212
+ } , 500 ) ;
213
+
205
214
}
206
215
207
216
var showDiff = function ( ) {
@@ -282,6 +291,11 @@ var loadCommitDetails = function(data)
282
291
{
283
292
commit . parseDetails ( data ) ;
284
293
294
+ if ( commit . notificationID )
295
+ clearTimeout ( commit . notificationID )
296
+ else
297
+ $ ( "notification" ) . style . display = "none" ;
298
+
285
299
var formatEmail = function ( name , email ) {
286
300
return email ? name + " <<a href='mailto:" + email + "'>" + email + "</a>>" : name ;
287
301
}
0 commit comments