listenToCkeditor(editor).ready(({ ckeditor }) => {
if (ckeditor.features.quoteBlock) {
quoteLists.set(editorId, new QuoteList(editorId, ckeditor));
-
- setActiveEditor(ckeditor, true);
- } else {
- setActiveEditor(ckeditor, false);
}
- //TODO handle active editor changed
+ setActiveEditor(ckeditor, ckeditor.features.quoteBlock);
+
+ ckeditor.focusTracker.on("change:isFocused", (_evt: unknown, _name: unknown, isFocused: boolean) => {
+ if (isFocused) {
+ setActiveEditor(ckeditor, ckeditor.features.quoteBlock);
+ }
+ });
});
}
(0, Event_1.listenToCkeditor)(editor).ready(({ ckeditor }) => {
if (ckeditor.features.quoteBlock) {
quoteLists.set(editorId, new QuoteList(editorId, ckeditor));
- (0, Message_1.setActiveEditor)(ckeditor, true);
}
- else {
- (0, Message_1.setActiveEditor)(ckeditor, false);
- }
- //TODO handle active editor changed
+ (0, Message_1.setActiveEditor)(ckeditor, ckeditor.features.quoteBlock);
+ ckeditor.focusTracker.on("change:isFocused", () => {
+ if (ckeditor.focusTracker.isFocused) {
+ (0, Message_1.setActiveEditor)(ckeditor, ckeditor.features.quoteBlock);
+ }
+ });
});
}
});