diff options
| author | Jacob Thornton <[email protected]> | 2011-12-24 22:56:01 -0800 |
|---|---|---|
| committer | Jacob Thornton <[email protected]> | 2011-12-24 22:56:01 -0800 |
| commit | 823d89dbb23511b7ee929ddbd62661be751429d6 (patch) | |
| tree | 7f582e1c59d407137f9f7962190f111947e0a04e | |
| parent | 076370f3f9076b177a1f9c8ba9f536faa1a58957 (diff) | |
| download | bootstrap-823d89dbb23511b7ee929ddbd62661be751429d6.tar.xz bootstrap-823d89dbb23511b7ee929ddbd62661be751429d6.zip | |
move position of twipsy into getPosition so it can easily be extended for svg use
| -rw-r--r-- | js/bootstrap-twipsy.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/js/bootstrap-twipsy.js b/js/bootstrap-twipsy.js index 21cf7d20b..2651e3822 100644 --- a/js/bootstrap-twipsy.js +++ b/js/bootstrap-twipsy.js @@ -125,10 +125,7 @@ .css({ top: 0, left: 0, display: 'block' }) .prependTo(inside ? this.$element : document.body) - pos = $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), { - width: this.$element[0].offsetWidth - , height: this.$element[0].offsetHeight - }) + pos = this.getPosition(inside) actualWidth = $tip[0].offsetWidth actualHeight = $tip[0].offsetHeight @@ -187,6 +184,13 @@ 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 () { var title , $e = this.$element |
