Core.ElementAllocator Class
Defined in:
src/core/ElementAllocator.js:13
Handles creating, allocating and removing DOM elements within a provided DOM element. Manages a pool of nodes based on DOM tagName for DOM node reuse. When a Surface is deallocated, its element is cleared and put back in the pool. When a Surface is allocated, an existing cleared element of the same tagName is looked for. If it is not found, a new DOM element is created.
Constructor
Item Index
Methods
Methods
allocate
(
Node
-
type
Allocate an element of specified type from the pool.
Parameters:
-
type
StringDOM tagName, e.g., "div"
Returns:
Node:
deallocate
(
-
element
De-allocate an element of specified type to the pool for recycling.
Parameters:
-
element
NodeDOM element
migrate
(
-
container
Move the DOM elements from their original container to a new one.
Parameters:
-
container
NodeDOM element