Skip to content

Commit

Permalink
Fixes #4264 When embedding the custom dashboard using &token_auth, ap…
Browse files Browse the repository at this point in the history
…pend it to the sparklines
  • Loading branch information
mattab committed Oct 31, 2013
1 parent 7e100e4 commit 4f1128e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugins/CoreHome/javascripts/sparkline.js
Expand Up @@ -23,7 +23,14 @@ piwik.initSparklines = function() {
}

var colors = JSON.stringify(piwik.getSparklineColors());
$self.attr('src', $self.attr('data-src') + '&colors=' + encodeURIComponent(colors));
var appendToSparklineUrl = '&colors=' + encodeURIComponent(colors);

// Append the token_auth to the URL if it was set (eg. embed dashboard)
var token_auth = broadcast.getValueFromUrl('token_auth');
if (token_auth.length) {
appendToSparklineUrl += '&token_auth=' + token_auth;
}
$self.attr('src', $self.attr('data-src') + appendToSparklineUrl);
});
};

Expand Down

0 comments on commit 4f1128e

Please sign in to comment.