diff --git a/js/bootstrap-tooltip.js b/js/bootstrap-tooltip.js index 49b5f7286a07331fb7b8faa3e2b483bd59f040fb..f28233a36098f70fdf1decf74885efa79723c837 100644 --- a/js/bootstrap-tooltip.js +++ b/js/bootstrap-tooltip.js @@ -120,9 +120,11 @@ inside = /in/.test(placement) + tp = { top: 0, left: 0, display: 'block' }; + $tip .remove() - .css({ top: 0, left: 0, display: 'block' }) + .css(tp) .appendTo(inside ? this.$element : document.body) pos = this.getPosition(inside) @@ -145,6 +147,10 @@ break } + /******** prevents tip from display off screen ************/ + if (tp.top < 0) { tp.top = 0; } + if (tp.left < 0) { tp.left = 0; } + $tip .css(tp) .addClass(placement) diff --git a/less/variables.less b/less/variables.less index 94c3a0667c1b636ea7cee41c5567b3f617cd0238..c2ec1f7f542b2dc1803a06bf57537436a582eb6b 100644 --- a/less/variables.less +++ b/less/variables.less @@ -115,7 +115,7 @@ // Try to avoid customizing these :) @zindexDropdown: 1000; @zindexPopover: 1010; -@zindexTooltip: 1020; +@zindexTooltip: 1031; @zindexFixedNavbar: 1030; @zindexModalBackdrop: 1040; @zindexModal: 1050;