Namespace: utils

utils

Collection of utility functions

Methods


getHashParam(property, defaultValue)

Gets the value of the specified hash parameter from the window URL
Parameters:
Name Type Description
property string The property key from hash parameter
defaultValue T Default return value
Returns:
A value of the hash parameter
Type
T

getScrollLeft(ele)

Gets the scrollLeft value for the element. Takes into account right to left scrolling direction if applicable.
Parameters:
Name Type Description
ele Element An HTML element to retrieve the scrollLeft value from
Returns:
The scrollLeft value of the element
Type
number

isBlendModeSupported(type)

Check if a composite operation is supported
Parameters:
Name Type Description
type string Composite operation to check
Returns:
True if if the input composite operation is supported, false otherwise
Type
boolean

setCanvasMultiplier(value)

Sets the default multiplier used for rendering pages with document.loadCanvasAsync. Higher multipliers mean that pages will be rendered at higher resolutions. The default value is the browser's devicePixelRatio
Parameters:
Name Type Description
value number The value of multiplier to be set

setIsWindowsApp(isWindowsApp)

Sets whether WebViewer is running inside a Windows App and should automatically use the WinRTPartRetriever for loading local XOD files
Parameters:
Name Type Description
isWindowsApp boolean Whether WebViewer is running inside a Windows app or not

unsetCanvasMultiplier()

Unsets the multiplier that was set using the setCanvasMultiplier function. The multiplier will default back to the browser's devicePixelRatio