Skip to content
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.

Commit

Permalink
Add a loading state to the sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
btaylor-litl committed Mar 30, 2011
1 parent 8037450 commit c9e2076
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions site_media/berserk/css/screen.css
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,10 @@ img a {
overflow: auto;
}

#timeline-sidebar-detail.loading {
background: #FFFFFF url('../images/spinner-white.gif') center center no-repeat;
}

#timeline-sidebar-detail p {
margin: 0;
padding: 0;
Expand Down
Binary file added site_media/berserk/images/spinner-white.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions site_media/berserk/js/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ Sidebar.prototype = {
data.update();
},

_setLoading : function (isLoading) {
var detail = $('#timeline-sidebar-detail');
if (isLoading)
detail.empty().addClass('loading');
else
detail.removeClass('loading');
},

_updateEventDisplay : function (id, time, message, task, comment) {
var timestr = this._dateFormatter.getDateTimeString(new Date(time * 1000));
$('#timeline-sidebar-event').empty()
Expand All @@ -107,8 +115,7 @@ Sidebar.prototype = {
if (this._activeTimeout)
clearTimeout(this._activeTimeout);

// TODO: show loading spinner
$('#timeline-sidebar-detail').empty();
this._setLoading(true);

var url = this._options.eventDetailUrl.replace('99', id);

Expand All @@ -121,6 +128,7 @@ Sidebar.prototype = {
if (klass._selectedId != id)
return;

klass._setLoading(false);
$('#timeline-sidebar-detail').html(data.detail);
$('#timeline-sidebar-commands').html(data.commands);

Expand Down

0 comments on commit c9e2076

Please sign in to comment.