Skip to content

Commit 059ddcf

Browse files
committed
Merge pull request #223 from jeff-phillips-18/fixes
Fixes to Heat Map directive to handle resizing
2 parents 947ff27 + 3c58645 commit 059ddcf

File tree

3 files changed

+34
-4
lines changed

3 files changed

+34
-4
lines changed

dist/angular-patternfly.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ angular.module('patternfly.charts').directive('pfEmptyChart', function () {
13881388
</file>
13891389
</example>
13901390
*/
1391-
angular.module('patternfly.charts').directive('pfHeatmap', ["$compile", function ($compile) {
1391+
angular.module('patternfly.charts').directive('pfHeatmap', ["$compile", "$window", function ($compile, $window) {
13921392
'use strict';
13931393
return {
13941394
restrict: 'A',
@@ -1563,6 +1563,21 @@ angular.module('patternfly.charts').directive('pfHeatmap', ["$compile", function
15631563
}
15641564
setStyles();
15651565
});
1566+
1567+
angular.element($window).bind('resize', function () {
1568+
setSizes();
1569+
redraw();
1570+
});
1571+
1572+
scope.$watch(
1573+
function () {
1574+
return [element[0].offsetWidth, element[0].offsetHeight].join('x');
1575+
},
1576+
function (value) {
1577+
setSizes();
1578+
redraw();
1579+
}
1580+
);
15661581
}
15671582
};
15681583
}]);

0 commit comments

Comments
 (0)