Fixed tooltip position for firefox
This commit is contained in:
parent
fab0701626
commit
7eda175d24
|
@ -38,6 +38,12 @@
|
||||||
height: this.$element[0].offsetHeight
|
height: this.$element[0].offsetHeight
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// XXX: sometimes pos.height is zero. I do not know why and I dont care.
|
||||||
|
if(isNaN(pos.height))
|
||||||
|
pos.height = 0;
|
||||||
|
if(isNaN(pos.width))
|
||||||
|
pos.width = 0;
|
||||||
|
|
||||||
var actualWidth = $tip[0].offsetWidth,
|
var actualWidth = $tip[0].offsetWidth,
|
||||||
actualHeight = $tip[0].offsetHeight,
|
actualHeight = $tip[0].offsetHeight,
|
||||||
gravity = maybeCall(this.options.gravity, this.$element[0]);
|
gravity = maybeCall(this.options.gravity, this.$element[0]);
|
||||||
|
@ -51,7 +57,7 @@
|
||||||
tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
|
tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
|
//tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
|
||||||
// XXX HACK: i want to set another offset so apparently I have to hardcode this into the code. obviously.
|
// XXX HACK: i want to set another offset so apparently I have to hardcode this into the code. obviously.
|
||||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2 + this.options.offset, left: pos.left - actualWidth};
|
tp = {top: pos.top + pos.height / 2 - actualHeight / 2 + this.options.offset, left: pos.left - actualWidth};
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue