Merge pull request #566 from jumpserver/pr@dev@fix_tree_rightclick

fix: 修复资产树超过屏幕,右键菜单显示不全问题
This commit is contained in:
老广
2021-01-06 11:03:30 +08:00
committed by GitHub

View File

@@ -157,6 +157,11 @@ export default {
y -= (offset.top + scrollTop) / 3 - 10
x += document.body.scrollLeft
y += document.body.scrollTop + document.documentElement.scrollTop
if (y + $(`#${rMenuID} ul`).height() >= window.innerHeight) {
y -= $(`#${rMenuID} ul`).height()
}
this.rMenu.css({ 'top': y + 'px', 'left': x + 'px', 'visibility': 'visible' })
$(`#${rMenuID} ul`).show()
$('body').bind('mousedown', this.onBodyMouseDown)