From 5bd8cdca91615dfb502131c276bfc6d8457c5f79 Mon Sep 17 00:00:00 2001 From: fat Date: Wed, 19 Dec 2012 21:36:50 -0800 Subject: =?UTF-8?q?remove=20inside=20support=20from=20tooltip=C2=A0+=20fix?= =?UTF-8?q?=20tooltip=20svg=20support=20+=20change=20makefile=20to=20rely?= =?UTF-8?q?=20on=20local=20npm=20install?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/bootstrap-tooltip.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'js/bootstrap-tooltip.js') diff --git a/js/bootstrap-tooltip.js b/js/bootstrap-tooltip.js index e7e2d6b3c..3be4a4a82 100644 --- a/js/bootstrap-tooltip.js +++ b/js/bootstrap-tooltip.js @@ -97,7 +97,6 @@ , show: function () { var $tip - , inside , pos , actualWidth , actualHeight @@ -116,19 +115,17 @@ this.options.placement.call(this, $tip[0], this.$element[0]) : this.options.placement - inside = /in/.test(placement) - $tip .detach() .css({ top: 0, left: 0, display: 'block' }) .insertAfter(this.$element) - pos = this.getPosition(inside) + pos = this.getPosition() actualWidth = $tip[0].offsetWidth actualHeight = $tip[0].offsetHeight - switch (inside ? placement.split(' ')[1] : placement) { + switch (placement) { case 'bottom': tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2} break @@ -193,11 +190,12 @@ return this.getTitle() } - , getPosition: function (inside) { - return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), { - width: this.$element[0].offsetWidth - , height: this.$element[0].offsetHeight - }) + , getPosition: function () { + var el = this.$element[0] + return $.extend(el.getBoundingClientRect ? el.getBoundingClientRect() : { + width: el.offsetWidth + , height: el.offsetHeight + }, this.$element.offset()) } , getTitle: function () { -- cgit v1.2.3 From 219d275ae67e58f3a4c1d0a2b2daeff427adbaf6 Mon Sep 17 00:00:00 2001 From: fat Date: Wed, 19 Dec 2012 22:03:57 -0800 Subject: can't extend bounding box thingy --- js/bootstrap-tooltip.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/bootstrap-tooltip.js') diff --git a/js/bootstrap-tooltip.js b/js/bootstrap-tooltip.js index 3be4a4a82..25bba1589 100644 --- a/js/bootstrap-tooltip.js +++ b/js/bootstrap-tooltip.js @@ -192,7 +192,7 @@ , getPosition: function () { var el = this.$element[0] - return $.extend(el.getBoundingClientRect ? el.getBoundingClientRect() : { + return $.extend({}, el.getBoundingClientRect ? el.getBoundingClientRect() : { width: el.offsetWidth , height: el.offsetHeight }, this.$element.offset()) -- cgit v1.2.3