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

Sticky element position don't rerendred on resize

Open carpogoryanin opened this issue 7 years ago • 1 comments

Hi. I use this code for program usage of angular-sticky and add resize into events. resize events working, but sticky elemen not rerendered. Only after scroll it fix position:

angular.element($window).bind('scroll resize', function() {
	// draw the sticky element through an apply as the event wasn't from Angular
	$scope.$apply(function() {
		stickyElement.draw();
	});
});

Do you have some ideas what wrong?

carpogoryanin avatar Dec 15 '17 11:12 carpogoryanin

You could use angular.element(document.body).injector().get('hlStickyElement')(stickyElement).draw()

On my page doesn't recalculate the correct height of the containers, but on your page maybe will work :)

PS: stickyElement I assume that is an Angular Element type already initialised.

catalinoprea avatar Mar 26 '18 15:03 catalinoprea