Fixed tooltip position for firefox

This commit is contained in:
Sebastian Lohff 2015-03-28 21:22:00 +01:00
parent fab0701626
commit 7eda175d24
1 changed files with 7 additions and 1 deletions

View File

@ -38,6 +38,12 @@
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,
actualHeight = $tip[0].offsetHeight,
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};
break;
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.
tp = {top: pos.top + pos.height / 2 - actualHeight / 2 + this.options.offset, left: pos.left - actualWidth};
break;