Commit 6c92f472 by ramdayalmunda

caret display when blur

parent 3390b13d
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
.a-doc-editor canvas:focus-visible { .a-doc-editor canvas:focus-visible {
/* outline: auto rgb(0, 68, 255, 50%); */ /* outline: auto rgb(0, 68, 255, 50%); */
outline: none;
background: #fff; background: #fff;
} }
...@@ -52,6 +53,7 @@ ...@@ -52,6 +53,7 @@
.a-doc-editor .body .right-sidebar { .a-doc-editor .body .right-sidebar {
position: absolute; position: absolute;
padding: 8px;
height: 100%; height: 100%;
right: 0; right: 0;
width: 17%; width: 17%;
...@@ -61,7 +63,7 @@ ...@@ -61,7 +63,7 @@
} }
.a-doc-editor .body .right-sidebar.hide { .a-doc-editor .body .right-sidebar.hide {
right: -14%; right: -16%;
transition: 300ms; transition: 300ms;
} }
......
...@@ -86,14 +86,16 @@ var ADocEditor = function (customConfig) { ...@@ -86,14 +86,16 @@ var ADocEditor = function (customConfig) {
<div class="scrolling-area" id="${scrollingAreaId}"></div> <div class="scrolling-area" id="${scrollingAreaId}"></div>
<div class="left-sidebar hide" id="${leftSidebarId}"> <div class="left-sidebar hide" id="${leftSidebarId}">
<div class="toggle-sidebar"> <div class="toggle-sidebar">
<span></span>
<span>Summary</span> <span>Summary</span>
<span>X</span> <span>&lrarr;</span>
</div> </div>
</div> </div>
<div class="right-sidebar hide" id="${rightSidebarId}"> <div class="right-sidebar hide" id="${rightSidebarId}">
<div class="toggle-sidebar"> <div class="toggle-sidebar">
<span>X</span> <span>&lrarr;</span>
<span>Comments</span> <span>Comments</span>
<span></span>
</div> </div>
</div> </div>
</div> </div>
...@@ -223,7 +225,7 @@ var ADocEditor = function (customConfig) { ...@@ -223,7 +225,7 @@ var ADocEditor = function (customConfig) {
return true return true
} }
if (!caretData.blink && focusedCanvas && caretData.activeData) renderCaret() if (!caretData.blink && caretData.activeData) renderCaret()
// to render caret // to render caret
function renderCaret() { function renderCaret() {
let ctx = canvasList[caretData.canvasIndex].getContext('2d', { willReadFrequently: true }) let ctx = canvasList[caretData.canvasIndex].getContext('2d', { willReadFrequently: true })
...@@ -273,7 +275,7 @@ var ADocEditor = function (customConfig) { ...@@ -273,7 +275,7 @@ var ADocEditor = function (customConfig) {
} }
function onBlurHandler(e) { function onBlurHandler(e) {
focusedCanvas = null focusedCanvas = null
caretData.blink = true caretData.blink = false
reRenderPages(dataSet) reRenderPages(dataSet)
clearInterval(caretData.interval) clearInterval(caretData.interval)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment