0

I'm using the UI-Calendar directive for Full Calendar and I have some resizing issues. The div that the calendar is in can change size based on an event which changes the div's class and thereby it's size. When this happens, the calendar redraws incorrectly. I can detect when the trigger occurs, but this seems to be inside the digest loop, i.e. before the element has actually changed sizes, so telling fullcalendar to redraw at this point is not helping.

Neither does jQuery.resize seem to fire (either by using angular's jqlite or the real jQuery). BTW, window resize does fire.

Currently, I'm solving it with a a $timeout every 100ms to check if the size has changed, which is a rather gross hack.

How can i either get notified when a div has resized or hook into the end of the digest loop, so that I see the size change reflected?

Arne Claassen
  • 14,088
  • 5
  • 67
  • 106

1 Answers1

0

The resize event only fires when it's bound to the window (except for IE, where you can bind it to any HTML element). Here, more about that.

Checkout http://marcj.github.io/css-element-queries/ for an efficient solution.

Community
  • 1
  • 1
bengro
  • 1,004
  • 10
  • 19