Further handle cases in the graphing library where the container element is no longer avaliable
This commit is contained in:
parent
6b131fe032
commit
7fc204fe70
1 changed files with 12 additions and 2 deletions
|
@ -1135,7 +1135,12 @@ FileTreeBase.prototype.update_ = function(source) {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Update the height of the container and the SVG.
|
// Update the height of the container and the SVG.
|
||||||
document.getElementById(this.container_).style.height = this.getContainerHeight_() + 'px';
|
var containerElm = document.getElementById(this.container_);
|
||||||
|
if (!containerElm) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
containerElm.style.height = this.getContainerHeight_() + 'px';
|
||||||
svg.attr('height', this.getContainerHeight_());
|
svg.attr('height', this.getContainerHeight_());
|
||||||
|
|
||||||
// Compute the flattened node list.
|
// Compute the flattened node list.
|
||||||
|
@ -1697,7 +1702,12 @@ LogUsageChart.prototype.handleStateChange_ = function(e) {
|
||||||
*/
|
*/
|
||||||
LogUsageChart.prototype.draw = function(container, logData, startDate, endDate) {
|
LogUsageChart.prototype.draw = function(container, logData, startDate, endDate) {
|
||||||
// Reset the container's contents.
|
// Reset the container's contents.
|
||||||
document.getElementById(container).innerHTML = '<svg></svg>';
|
var containerElm = document.getElementById(container);
|
||||||
|
if (!containerElm) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
containerElm.innerHTML = '<svg></svg>';
|
||||||
|
|
||||||
// Returns a date offset from the given date by "days" Days.
|
// Returns a date offset from the given date by "days" Days.
|
||||||
var offsetDate = function(d, days) {
|
var offsetDate = function(d, days) {
|
||||||
|
|
Reference in a new issue