(state: boolean)
| 45 | }; |
| 46 | |
| 47 | const toggleGlobalEvents = (state: boolean) => { |
| 48 | if (state !== boundGlobalEvents) { |
| 49 | const DOM = DOMUtils.DOM; |
| 50 | if (state) { |
| 51 | DOM.bind(window, 'resize', globalEventDelegate); |
| 52 | DOM.bind(window, 'scroll', globalEventDelegate); |
| 53 | } else { |
| 54 | DOM.unbind(window, 'resize', globalEventDelegate); |
| 55 | DOM.unbind(window, 'scroll', globalEventDelegate); |
| 56 | } |
| 57 | |
| 58 | boundGlobalEvents = state; |
| 59 | } |
| 60 | }; |
| 61 | |
| 62 | const removeEditorFromList = (targetEditor: Editor) => { |
| 63 | const oldEditors = editors; |