Skip to content

Loading…

Draw other people's cursors behind CodeMirror. #18

Merged
merged 1 commit into from

2 participants

@mikelehen

Attempt #2. Looks like CodeMirror's z-indexes changed recently. Setting the cursorEl's z-index to 0 now makes it visible, but not interfere with clicks.

@mikelehen mikelehen Draw other people's cursors behind CodeMirror.
Set z-index of other cursors to 0 so they don't interfere with codemirror's click handlers.  Without this, if you click on/around somebody else's cursor, your cursor won't move since the click is going to the pre element instead of to CodeMirror.
9b0933f
@timjb timjb merged commit 0892399 into Operational-Transformation:master

1 check passed

Details default The Travis build passed
@timjb
Operational-Transformation member

Merged. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 17, 2013
  1. @mikelehen

    Draw other people's cursors behind CodeMirror.

    mikelehen committed
    Set z-index of other cursors to 0 so they don't interfere with codemirror's click handlers.  Without this, if you click on/around somebody else's cursor, your cursor won't move since the click is going to the pre element instead of to CodeMirror.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/codemirror-adapter.js
View
1 lib/codemirror-adapter.js
@@ -224,6 +224,7 @@ ot.CodeMirrorAdapter = (function () {
cursorEl.style.borderLeftColor = color;
cursorEl.style.height = (cursorCoords.bottom - cursorCoords.top) * 0.9 + 'px';
cursorEl.style.marginTop = (cursorCoords.top - cursorCoords.bottom) + 'px';
+ cursorEl.style.zIndex = 0;
cursorEl.setAttribute('data-clientid', clientId);
this.cm.addWidget(cursorPos, cursorEl, false);
return {
Something went wrong with that request. Please try again.