angular-vertilize icon indicating copy to clipboard operation
angular-vertilize copied to clipboard

Calculations are wrong if used inside Bootstrap tab (and potentially other DOM changes)

Open roberttolton opened this issue 9 years ago • 1 comments

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).

roberttolton avatar Feb 26 '16 17:02 roberttolton

As a dirty workaround you can try the following:

  1. Add something like uib-tab(select='vm.triggerResizeEvent()') to tab with "vertilized" content.
  2. 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 :)

ajordanow avatar Apr 22 '16 22:04 ajordanow