angular-vertilize
angular-vertilize copied to clipboard
Calculations are wrong if used inside Bootstrap tab (and potentially other DOM changes)
I don't see a method in the documentation to force a re-calculation, would such a thing be workable?
The calculations are fine on the first load if they are in the first active tab, but if you switch to another tab or they aren't in the first active tab, the heights are miscalculated (due to the elements not being visible at the time of calculation I would assume).
As a dirty workaround you can try the following:
- Add something like
uib-tab(select='vm.triggerResizeEvent()')to tab with "vertilized" content. - Implement
triggerResizeEvent()in the corresponding controller:
this.triggerResizeEvent = function () {
// without this resize event fires too early
$window.requestAnimationFrame(function () {
$timeout(function () {
angular.element($window).trigger('resize');
});
});
};
It flickers a bit but at least works :)