Skip to main content

updateHtmlAnchor

@combeenation/custom-code-utils


Variable: updateHtmlAnchor()

const updateHtmlAnchor: (htmlAssets, sdCtrlName?, queued) => Promise<SDUpdateQueueResult> = SdvHtmlAnchor.updateHtmlAnchor

Function for adding and updating anchor assets with a customizable HTML string as content.
Adding, removing and updating the asset position is already handled within this function, whereas these tasks can be exchanged or extended by the user to solve specific use cases.

Parameters

htmlAssets

HtmlAnchorAsset[]

Configuration of assets which should be updated, see Cbn.CustomCode.HtmlAnchorAsset for detailed info

sdCtrlName?

string

Optional name of the associated Shapediver control.
If not configured, the first shapediver instance of the configurator is used.

queued?

boolean = false

true: Assets will be updated after all currently pending asset updates are finished.
In this case the current asset update will not be aborted, which could otherwise lead to missing or erronous asset updates.
false: Assets will be updated in the next JS cycle, no matter if other asset updates are currently pending.
Asset updates which are triggered within the same JS cycle are accumulated and applied in one update.

Returns

Promise<SDUpdateQueueResult>