Improve cursor in pad

pull/1/head
yflory 6 years ago
parent 7bbf6951f2
commit 1a0344547b

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

@ -73,6 +73,10 @@ define([
el: range[t + 'Container'], el: range[t + 'Container'],
offset: range[t + 'Offset'] 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 current = inNode.el;
var path = []; var path = [];
while (current !== element) { while (current !== element) {

Loading…
Cancel
Save