commit 386c39252764692ac71e0ca7a40340bd32a31b94
parent 698c7ca8746625229a98517c906c1ecfb3778844
Author: Sanjog Sharma <sanjogsharma@gmail.com>
Date: Thu, 14 Nov 2019 11:56:22 -0500
added se-focus class to editor when in focus
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/striveneditor.js b/src/striveneditor.js
@@ -517,9 +517,18 @@ export default class StrivenEditor {
!document.queryCommandState(opt) && this.executeCommand(opt);
})
+ this.editor.classList.add("se-focus");
+
bodyFocus && bodyFocus();
}
+ const bodyBlur =body.onblur;
+ body.onblur =(e) =>{
+ this.editor.classList.remove("se-focus");
+
+ bodyBlur && bodyBlur();
+ }
+
const bodyClick = body.onclick;
body.onclick = () => {
body.textContent && this.toolbarState();