Module: delite/Viewport

delite/Viewport

Utility singleton to watch for viewport resizes, avoiding duplicate notifications which can lead to infinite loops.

Usage:

Viewport.on("resize", myCallback)
Viewport.on("scroll", myOtherCallback)

myCallback() is called without arguments in case it's Widget.resize(), which would interpret the argument as the size to make the widget.

Show inherited

Methods

<static> getEffectiveBox()

Get the size of the viewport, or on mobile devices, the part of the viewport not obscured by the virtual keyboard.

Source: