Improve cursor in pad

This commit is contained in:
yflory 2018-12-11 15:59:40 +01:00
parent 7bbf6951f2
commit 1a0344547b
2 changed files with 8 additions and 0 deletions

View File

@ -158,14 +158,18 @@ a > img {
border: 2px solid red;
border-right-color: transparent !important;
border-left-color: transparent !important;
margin-left: -2px;
margin-right: -2px;
}
.cp-cursor-position[data-type="start"] {
border-left: none;
border-right-width: 4px;
margin-right: -4px;
}
.cp-cursor-position[data-type="end"] {
border-right: none;
border-left-width: 4px;
margin-left: -4px;
}
.cp-cursor-avatar {
display: flex;

View File

@ -73,6 +73,10 @@ define([
el: range[t + 'Container'],
offset: range[t + 'Offset']
};
while (inNode.el.nodeType !== Node.TEXT_NODE && inNode.el.childNodes.length > inNode.offset) {
inNode.el = inNode.el.childNodes[inNode.offset];
inNode.offset = 0;
}
var current = inNode.el;
var path = [];
while (current !== element) {