Fix a circular re-layout when Admin Dashboard widgets change size.

Review Request #10784 — Created Nov. 4, 2019 and updated

chipx86
Review Board
release-4.0.x
7f87c08...
reviewboard

Sometimes when the Admin Dashboard positions or updates widgets, it can
result in the widget triggering a sizeChanged event, which would then
cause another layout. This resulted in a potential infinite loop, which
JavaScript would notice and abort.

The solution to this is to only cause a re-layout if the widget actually
did change size, and not just when it claimed to. This takes advantage
of the existing widget size tracking, preventing unnecessary
updateSize() calls in response to a layout change.

Verified the infinite loops I was triggering had disappeared.

Unit tests passed.

Checks run (2 succeeded)
flake8 passed.
JSHint passed.
david
  1. Ship It!
  2. 
      
Loading...