Fix tip position when the bottom of the tip is greater then browser height.
This commit is contained in:
parent
e198458d58
commit
f76532ac36
|
@ -154,11 +154,15 @@
|
||||||
|
|
||||||
if (typeof at == 'object') {
|
if (typeof at == 'object') {
|
||||||
var tp = {top: at[1] + 15, left: at[0] + 18},
|
var tp = {top: at[1] + 15, left: at[0] + 18},
|
||||||
innerWidth = Common.Utils.innerWidth();
|
innerWidth = Common.Utils.innerWidth(),
|
||||||
|
innerHeight = Common.Utils.innerHeight();
|
||||||
|
|
||||||
if (tp.left + $tip.width() > innerWidth) {
|
if (tp.left + $tip.width() > innerWidth) {
|
||||||
tp.left = innerWidth - $tip.width() - 30;
|
tp.left = innerWidth - $tip.width() - 30;
|
||||||
}
|
}
|
||||||
|
if (tp.top + $tip.height() > innerHeight) {
|
||||||
|
tp.top = innerHeight - $tip.height() - 30;
|
||||||
|
}
|
||||||
|
|
||||||
$tip.offset(tp).addClass('in');
|
$tip.offset(tp).addClass('in');
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue