These alignment utilities can be used within a custom Brics logic in order to manage the alignment of elements within the HTML.
Apply Alignment Class applyAlignmentClass( target, position, sync )
When called, this function will apply the relevant Bootstrap framework alignment class ( text-start | text-center | text-end ) for the provided target element, it supports breakpoints and replaces any current alignment class for the active breakpoint that may already be applied. It also automatically handles the differences in class names for Bootstrap 4 ( text-left | text-center | text-right ).
Get Alignment State getAlignmentState( target )
When called, this function will get the current Bootstrap framework alignment class used on a target element ( text-start | text-center | text-end ) based on the active breakpoint and Bootstrap version. This function will return an integer value of either 0 (left), 1 (center) or 2 (right), which can be used to populate your Brics control user interface.
Generate Random Integer getRandomInt( min, max )
When called, this function will generate and return a random integer value between the minimum and maximum integer variables provided.
Get Asset Export Path getAssetExportPath( assetPath )
This function will return the export path for a given local asset path, e.g. local/file/system/filename.jpg > img/filename.jpg.
Debug bricDebug( string )
When called, this function will generate a debug message to the Blocs developer console.