Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorfat <jacobthornton@gmail.com>2012-12-20 09:36:50 +0400
committerfat <jacobthornton@gmail.com>2012-12-20 09:36:50 +0400
commit5bd8cdca91615dfb502131c276bfc6d8457c5f79 (patch)
tree34ad0963307233945a0fc6beef8e21c0f1343753 /js
parent529ecc5a77c9e653dd7219bd4457cb994e338075 (diff)
remove inside support from tooltip + fix tooltip svg support + change makefile to rely on local npm install
Diffstat (limited to 'js')
-rw-r--r--js/bootstrap-tooltip.js18
1 files changed, 8 insertions, 10 deletions
diff --git a/js/bootstrap-tooltip.js b/js/bootstrap-tooltip.js
index e7e2d6b3c4..3be4a4a821 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 () {