* Insert new Block into DOM * * @param {Block} block - Block to insert * @param {InsertPosition} position — insert position (if set, will use insertAdjacentElement) * @param {Block} target — Block related to position
(block: Block, position?: InsertPosition, target?: Block)
| 346 | * @param {Block} target — Block related to position |
| 347 | */ |
| 348 | private insertToDOM(block: Block, position?: InsertPosition, target?: Block): void { |
| 349 | if (position) { |
| 350 | target.holder.insertAdjacentElement(position, block.holder); |
| 351 | } else { |
| 352 | this.workingArea.appendChild(block.holder); |
| 353 | } |
| 354 | |
| 355 | block.call(BlockToolAPI.RENDERED); |
| 356 | } |
| 357 | |
| 358 | /** |
| 359 | * Composes Block event with passed type and details |