mirror of https://github.com/ElemeFE/element
Tree: show indicator in drop node (#12854)
parent
861b0b294b
commit
0e617d0fc6
|
@ -420,14 +420,15 @@
|
||||||
dropType = 'none';
|
dropType = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const iconPosition = dropNode.$el.querySelector('.el-tree-node__expand-icon').getBoundingClientRect();
|
||||||
const dropIndicator = this.$refs.dropIndicator;
|
const dropIndicator = this.$refs.dropIndicator;
|
||||||
if (dropType === 'before') {
|
if (dropType === 'before') {
|
||||||
indicatorTop = targetPosition.top - treePosition.top;
|
indicatorTop = iconPosition.top - treePosition.top;
|
||||||
} else if (dropType === 'after') {
|
} else if (dropType === 'after') {
|
||||||
indicatorTop = targetPosition.bottom - treePosition.top;
|
indicatorTop = iconPosition.bottom - treePosition.top;
|
||||||
}
|
}
|
||||||
dropIndicator.style.top = indicatorTop + 'px';
|
dropIndicator.style.top = indicatorTop + 'px';
|
||||||
dropIndicator.style.left = (targetPosition.right - treePosition.left) + 'px';
|
dropIndicator.style.left = (iconPosition.right - treePosition.left) + 'px';
|
||||||
|
|
||||||
if (dropType === 'inner') {
|
if (dropType === 'inner') {
|
||||||
addClass(dropNode.$el, 'is-drop-inner');
|
addClass(dropNode.$el, 'is-drop-inner');
|
||||||
|
|
Loading…
Reference in New Issue