树菜单弹出位置优化
This commit is contained in:
parent
ffa61c83b2
commit
7da9a49d2c
|
@ -249,8 +249,12 @@ var tree = {
|
||||||
$fileRMenu.find(".remove").addClass("disabled");
|
$fileRMenu.find(".remove").addClass("disabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var top = event.clientY - 10;
|
||||||
|
if ($fileRMenu.height() + top > $('.content').height()) {
|
||||||
|
top = top - $fileRMenu.height() - 25;
|
||||||
|
}
|
||||||
$fileRMenu.css({
|
$fileRMenu.css({
|
||||||
"top": event.clientY - 10 + "px",
|
"top": top + "px",
|
||||||
"left": event.clientX + "px",
|
"left": event.clientX + "px",
|
||||||
"display": "block"
|
"display": "block"
|
||||||
}).show();
|
}).show();
|
||||||
|
@ -269,8 +273,13 @@ var tree = {
|
||||||
$dirRMenu.find(".create").addClass("disabled");
|
$dirRMenu.find(".create").addClass("disabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var top = event.clientY - 10;
|
||||||
|
if ($dirRMenu.height() + top > $('.content').height()) {
|
||||||
|
top = top - $dirRMenu.height() - 25;
|
||||||
|
}
|
||||||
|
|
||||||
$dirRMenu.css({
|
$dirRMenu.css({
|
||||||
"top": event.clientY - 10 + "px",
|
"top": top + "px",
|
||||||
"left": event.clientX + "px",
|
"left": event.clientX + "px",
|
||||||
"display": "block"
|
"display": "block"
|
||||||
}).show();
|
}).show();
|
||||||
|
|
Loading…
Reference in New Issue