DomUtilities | django_cradmin API Document

    import DomUtilities from 'django_cradmin/scripts/django_cradmin/utilities/DomUtilities.js'

public class | source

# DomUtilities

General purpose DOM utilities.

## Static Method Summary

Static Public Methods
public static | forceFocus(domElement: Element, maxAttempts: Number, pollIntervalMilliseconds: Number) Force focus on a DOM element. |
public static | hide(element: *) |
public static | show(element: *, displayStyle: string) |

## Static Public Methods

### public static forceFocus(domElement: Element, maxAttempts: Number, pollIntervalMilliseconds: Number) source

Force focus on a DOM element.

Works around timing issues with visibility and signals by trying multiple times with a short interval between each attempt.

#### Params:

Name | Type | Attribute | Description
domElement | Element |  | A DOM Element.
maxAttempts | Number |  | Number of attempts to make. The first attempt is made at once, and the other attempts is performed each `pollIntervalMilliseconds` until we get focus, or we have used up the attempts.
pollIntervalMilliseconds | Number |  | Numer of milliseconds between each attempt.

### public static hide(element: *) source

#### Params:

Name | Type | Attribute | Description
element | * |  |

### public static show(element: *, displayStyle: string) source

#### Params:

Name | Type | Attribute | Description
element | * |  |
displayStyle | string | optional default: block |