Fix resize issue on build pack tree

This commit is contained in:
Joseph Schorr 2014-02-17 21:21:55 -05:00
parent d1922c6fd2
commit 0e566b63cf
2 changed files with 7 additions and 4 deletions

View file

@ -785,7 +785,10 @@ function BuildPackageCtrl($scope, Restangular, ApiService, $routeParams, $rootSc
};
$scope.initializeTree = function() {
if ($scope.drawn) { return; }
if ($scope.drawn) {
$scope.tree.notifyResized();
return;
}
$scope.drawn = true;
$timeout(function() {

View file

@ -857,10 +857,10 @@ FileTreeBase.prototype.calculateDimensions_ = function(container) {
var margin = { top: 40, right: 00, bottom: 20, left: 20 };
var m = [margin.top, margin.right, margin.bottom, margin.left];
var w = cw - m[1] - m[3];
var h = ch - m[0] - m[2];
var w = Math.max(0, cw - m[1] - m[3]);
var h = Math.max(0, ch - m[0] - m[2]);
var barWidth = cw * 0.8 - m[1] - m[3];
var barWidth = Math.max(0, cw * 0.8 - m[1] - m[3]);
return {
'w': w,