Replace spin.js with animated gif for updating table rows.

Fixes bug 1035111

Change-Id: Ideccd6090d1ec5fd0830a1468479c3b0edde9800
This commit is contained in:
Tres Henry 2012-08-09 15:14:03 -07:00
parent c779f4c919
commit dfdb8375de
3 changed files with 74 additions and 65 deletions

View File

@ -61,13 +61,13 @@ horizon.datatables = {
if($new_row.hasClass('status_unknown')) {
var spinner_elm = $new_row.find("td.status_unknown:last");
// FIXME(gabriel): This style mucking shouldn't be in the javascript.
spinner_elm.css('padding-left', '32px');
spinner_elm.spin(horizon.conf.spinner_options.inline);
$(spinner_elm.data().spinner.el).css('top', '9px');
$(spinner_elm.data().spinner.el).css('left', '-15px');
// Replacing spin.js here with an animated gif to reduce CPU
spinner_elm.prepend(
$("<div />")
.addClass("loading_gif")
.append(
$("<img />")
.attr("src", "/static/dashboard/img/loading.gif")));
}
// Only replace row if the html content has changed

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -1380,3 +1380,12 @@ label.log-length {
.dropdown_fix {
overflow: visible;
}
/* Replaces CPU hungry spin.js with animated gif */
.loading_gif {
width: 35px;
height: 13px;
padding-top: 2px;
padding-right: 5px;
float: left;
}