Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
Fix dashboard to properly load first time
Browse files Browse the repository at this point in the history
  • Loading branch information
propyless committed May 21, 2016
1 parent 9667792 commit c2159fe
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions panopuppet/pano/templates/pano/dashboard.html
Expand Up @@ -59,15 +59,18 @@
function get_data() {
var backgroundTask = $.Deferred();
var url = '../api/dashboard/';
var show_type = $('#' + GetURLParameter('show'));
if (typeof GetURLParameter('show') != 'undefined') {

if (typeof (GetURLParameter('show')) != 'undefined') {
var show_type = $('#' + GetURLParameter('show'));
url = url + show_type.attr('href');
}
else if (typeof GetURLParameter('show') == 'undefined') {
show_type ='?show=recent';
url = url + show_type;
else if (typeof (GetURLParameter('show')) == 'undefined') {
show_type = $('#recent');
url = url + show_type.attr('href');
}

$(show_type).addClass("active").prependTo($(show_type).parent()).siblings().removeClass("active");

$.get(url, function (json) {
var response = $(jQuery(json));
var nodes = response[0]['node_list'];
Expand Down

0 comments on commit c2159fe

Please sign in to comment.