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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -1240,105 +1240,105 @@ label.log-length {
/* Project Membership UI */ /* Project Membership UI */
.project_membership { .project_membership {
min-height: 200px; min-height: 200px;
/* Buttons */ /* Buttons */
.btn-group { .btn-group {
margin-left:0px; margin-left:0px;
padding: 2px 10px 0 0; padding: 2px 10px 0 0;
margin-bottom: 0px; margin-bottom: 0px;
border: 1px solid #DDD; border: 1px solid #DDD;
border-bottom: none; border-bottom: none;
} }
.btn-group:last-child { .btn-group:last-child {
border-bottom: 1px solid #DDD; border-bottom: 1px solid #DDD;
} }
.btn-group:nth-child(odd) { .btn-group:nth-child(odd) {
background-color: #F9F9F9; background-color: #F9F9F9;
} }
.btn-group .active { .btn-group .active {
float: right; float: right;
} }
a.btn-primary:hover { a.btn-primary:hover {
background-color: #04C; background-color: #04C;
} }
/* Header */ /* Header */
.help_text { .help_text {
margin-left: 15px; margin-left: 15px;
margin-bottom: 15px; margin-bottom: 15px;
} }
.users_title { .users_title {
color: #555; color: #555;
font-weight: bold; font-weight: bold;
padding-left: 10px; padding-left: 10px;
float: left; float: left;
} }
input { input {
background: url(/static/dashboard/img/search.png) no-repeat 105px 5px whiteSmoke; background: url(/static/dashboard/img/search.png) no-repeat 105px 5px whiteSmoke;
} }
.fake_table_header { .fake_table_header {
background-color: #F1F1F1; background-color: #F1F1F1;
width: 306px; width: 306px;
height: 38px; height: 38px;
padding-top: 15px; padding-top: 15px;
border: 1px solid #DDD; border: 1px solid #DDD;
border-bottom: none; border-bottom: none;
} }
/* 'Fake table' body */ /* 'Fake table' body */
.fake_table { .fake_table {
margin-left: 5px; margin-left: 5px;
width: 315px; width: 315px;
ul.no_results { ul.no_results {
width: 298px; width: 298px;
} }
ul.btn-group:hover { ul.btn-group:hover {
background-color: #DDD; background-color: #DDD;
} }
} }
.left { .left {
.fake_table_header { .fake_table_header {
width: 318px; width: 318px;
} }
} }
.right { .right {
.fake_table_header { .fake_table_header {
width: 318px; width: 318px;
margin-left: -15px; margin-left: -15px;
} }
.fake_table ul.no_results { .fake_table ul.no_results {
margin-left: -20px; margin-left: -20px;
} }
} }
/* User lists */ /* User lists */
.member { .member {
padding: 10px; padding: 10px;
text-align: left; text-align: left;
} }
.project_members { .project_members {
margin-left: -20px; margin-left: -20px;
} }
.project_members ul.btn-group, .project_members ul.btn-group,
.available_users ul.btn-group { .available_users ul.btn-group {
width: 308px; width: 308px;
} }
/* List filtering */ /* List filtering */
.filter { .filter {
width: 120px; width: 120px;
margin: -5px 13px 15px 0px; margin: -5px 13px 15px 0px;
float: right; float: right;
} }
.no_results { .no_results {
border: 1px solid #DDD; border: 1px solid #DDD;
padding: 10px; padding: 10px;
color: #08C; color: #08C;
} }
/* Role dropdown menus */ /* Role dropdown menus */
.role_dropdown li { .role_dropdown li {
cursor: pointer; cursor: pointer;
background: none; background: none;
float: none; float: none;
@@ -1356,27 +1356,36 @@ label.log-length {
&:hover { &:hover {
background-color: #CDCDCD; background-color: #CDCDCD;
} }
} }
.nav .role_options { .nav .role_options {
float: right; float: right;
padding-right: 5px; padding-right: 5px;
} }
} }
/* Inline user creation */ /* Inline user creation */
.add_user_btn { .add_user_btn {
display: inline; display: inline;
} }
#add_user { #add_user {
clear: both; clear: both;
} }
.add_user { .add_user {
float: right; float: right;
margin-top: 10px; margin-top: 10px;
margin-right: 15px; margin-right: 15px;
} }
/* Fixes overflow on dropdowns in modal */ /* Fixes overflow on dropdowns in modal */
.dropdown_fix { .dropdown_fix {
overflow: visible; overflow: visible;
}
/* Replaces CPU hungry spin.js with animated gif */
.loading_gif {
width: 35px;
height: 13px;
padding-top: 2px;
padding-right: 5px;
float: left;
} }