From dfdb8375de25e564fc0ffd71f9f239e9a95e6ce1 Mon Sep 17 00:00:00 2001 From: Tres Henry Date: Thu, 9 Aug 2012 15:14:03 -0700 Subject: [PATCH] Replace spin.js with animated gif for updating table rows. Fixes bug 1035111 Change-Id: Ideccd6090d1ec5fd0830a1468479c3b0edde9800 --- horizon/static/horizon/js/horizon.tables.js | 14 +- .../static/dashboard/img/loading.gif | Bin 0 -> 2947 bytes .../static/dashboard/less/horizon.less | 125 ++++++++++-------- 3 files changed, 74 insertions(+), 65 deletions(-) create mode 100644 openstack_dashboard/static/dashboard/img/loading.gif diff --git a/horizon/static/horizon/js/horizon.tables.js b/horizon/static/horizon/js/horizon.tables.js index 5d6849b48..f09be9bd3 100644 --- a/horizon/static/horizon/js/horizon.tables.js +++ b/horizon/static/horizon/js/horizon.tables.js @@ -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( + $("
") + .addClass("loading_gif") + .append( + $("") + .attr("src", "/static/dashboard/img/loading.gif"))); } // Only replace row if the html content has changed diff --git a/openstack_dashboard/static/dashboard/img/loading.gif b/openstack_dashboard/static/dashboard/img/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..3890f094786626af479c12475596880ecb80e8de GIT binary patch literal 2947 zcmb`Hc|ekB9>?YKh%5-tvO+q>or=S>lyu5Ov%^xW>6kV_q`>3|P|30qloSQ-skzfzvJ`#p6~nHv^hK= zkhH|k+3vQTT}4I3yLazKMn*GgVzMpIK$)8F4;S6BDw(W5tS-n6x~X|>wQ z%F2d@hT7U%gTYW=Ute8atyZg*N~KDrvimRFlvu~BsP*2N}>3<$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