Tree: show indicator in drop node (#12854)

pull/12858/head
hetech 2018-09-21 19:12:42 +08:00 committed by GitHub
parent 861b0b294b
commit 0e617d0fc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -420,14 +420,15 @@
dropType = 'none';
}
const iconPosition = dropNode.$el.querySelector('.el-tree-node__expand-icon').getBoundingClientRect();
const dropIndicator = this.$refs.dropIndicator;
if (dropType === 'before') {
indicatorTop = targetPosition.top - treePosition.top;
indicatorTop = iconPosition.top - treePosition.top;
} else if (dropType === 'after') {
indicatorTop = targetPosition.bottom - treePosition.top;
indicatorTop = iconPosition.bottom - treePosition.top;
}
dropIndicator.style.top = indicatorTop + 'px';
dropIndicator.style.left = (targetPosition.right - treePosition.left) + 'px';
dropIndicator.style.left = (iconPosition.right - treePosition.left) + 'px';
if (dropType === 'inner') {
addClass(dropNode.$el, 'is-drop-inner');