Skip to content

Commit

Permalink
browser: fix to show cursor blinking
Browse files Browse the repository at this point in the history
When an image is inserted, the cursor is not shown.

Change-Id: Iea305a9a666bf06c68e7407eac3252f7faab627a
Signed-off-by: Henry Castro <hcastro@collabora.com>
  • Loading branch information
hcvcastro authored and lpranam committed Mar 15, 2022
1 parent e87351b commit 68876cd
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions browser/src/layer/marker/Cursor.ts
Expand Up @@ -97,15 +97,19 @@ class Cursor {
return this.domAttached;
}

addCursorClass(visible: boolean) {
if (visible)
$('.leaflet-cursor').removeClass('blinking-cursor-hidden');
else
$('.leaflet-cursor').addClass('blinking-cursor-hidden');
}

isVisible(): boolean {
return this.visible;
}

onFocusBlur(ev: FocusEvent) {
if (ev.type === 'blur')
$('.leaflet-cursor').addClass('blinking-cursor-hidden');
else
$('.leaflet-cursor').removeClass('blinking-cursor-hidden');
this.addCursorClass(ev.type !== 'blur');
}

// position and size should be in core pixels.
Expand Down Expand Up @@ -161,13 +165,15 @@ class Cursor {
if (!paneBounds.contains(cursorBounds)) {
this.container.style.visibility = 'hidden';
this.visible = false;
this.addCursorClass(this.visible);
this.showCursorHeader();
return;
}
}

this.container.style.visibility = 'visible';
this.visible = true;
this.addCursorClass(this.visible);

var tileSectionPos = this.map._docLayer.getTileSectionPos();
// Compute tile-section offset in css pixels.
Expand Down

0 comments on commit 68876cd

Please sign in to comment.