Updated JS to support new flyouts