* Bind Block events * * @param {Block} block - Block to which event should be bound
(block: Block)
| 933 | * @param {Block} block - Block to which event should be bound |
| 934 | */ |
| 935 | private bindBlockEvents(block: Block): void { |
| 936 | const { BlockEvents } = this.Editor; |
| 937 | |
| 938 | this.readOnlyMutableListeners.on(block.holder, 'keydown', (event: KeyboardEvent) => { |
| 939 | BlockEvents.keydown(event); |
| 940 | }); |
| 941 | |
| 942 | this.readOnlyMutableListeners.on(block.holder, 'keyup', (event: KeyboardEvent) => { |
| 943 | BlockEvents.keyup(event); |
| 944 | }); |
| 945 | |
| 946 | this.readOnlyMutableListeners.on(block.holder, 'dragover', (event: DragEvent) => { |
| 947 | BlockEvents.dragOver(event); |
| 948 | }); |
| 949 | |
| 950 | this.readOnlyMutableListeners.on(block.holder, 'dragleave', (event: DragEvent) => { |
| 951 | BlockEvents.dragLeave(event); |
| 952 | }); |
| 953 | |
| 954 | block.on('didMutated', (affectedBlock: Block) => { |
| 955 | return this.blockDidMutated(BlockChangedMutationType, affectedBlock, { |
| 956 | index: this.getBlockIndex(affectedBlock), |
| 957 | }); |
| 958 | }); |
| 959 | } |
| 960 | |
| 961 | /** |
| 962 | * Disable mutable handlers and bindings |
no test coverage detected