Fix errant XHR request happening on every page

The check of the jquery selector by name will always return a
non-null object even if the object does not exist on the page,
the check needs to make sure the object returned doesn't
contain any items.

Change-Id: I51367547a37a2ee72ed300853d35d3cc6d89df7d
Fixes: bug #1132588
This commit is contained in:
David Lyle 2013-02-27 11:27:33 -07:00
parent 56af9bd145
commit b5f4d63c7c
1 changed files with 2 additions and 2 deletions

View File

@ -21,11 +21,11 @@ horizon.network_topology = {
$("#topologyCanvas").spin(horizon.conf.spinner_options.modal);
self.retrieve_network_info();
setInterval(horizon.network_topology.retrieve_network_info,
horizon.network_topology.reload_duration);
horizon.network_topology.reload_duration);
},
retrieve_network_info: function(){
var self = this;
if(!$("#networktopology")) {
if($("#networktopology").length === 0) {
return;
}
$.getJSON($("#networktopology").data('networktopology'),