mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
move position of twipsy into getPosition so it can easily be extended for svg use
This commit is contained in:
parent
076370f3f9
commit
823d89dbb2
12
js/bootstrap-twipsy.js
vendored
12
js/bootstrap-twipsy.js
vendored
@ -125,10 +125,7 @@
|
|||||||
.css({ top: 0, left: 0, display: 'block' })
|
.css({ top: 0, left: 0, display: 'block' })
|
||||||
.prependTo(inside ? this.$element : document.body)
|
.prependTo(inside ? this.$element : document.body)
|
||||||
|
|
||||||
pos = $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
|
pos = this.getPosition(inside)
|
||||||
width: this.$element[0].offsetWidth
|
|
||||||
, height: this.$element[0].offsetHeight
|
|
||||||
})
|
|
||||||
|
|
||||||
actualWidth = $tip[0].offsetWidth
|
actualWidth = $tip[0].offsetWidth
|
||||||
actualHeight = $tip[0].offsetHeight
|
actualHeight = $tip[0].offsetHeight
|
||||||
@ -187,6 +184,13 @@
|
|||||||
return this.getTitle()
|
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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
, getTitle: function () {
|
, getTitle: function () {
|
||||||
var title
|
var title
|
||||||
, $e = this.$element
|
, $e = this.$element
|
||||||
|
Loading…
x
Reference in New Issue
Block a user