aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2014-07-09 22:19:23 -0700
committerMark Otto <[email protected]>2014-07-09 22:19:23 -0700
commitdae1a68fb15be9015760df32e85d764ef092db44 (patch)
tree23dbce03ca690c069a35b3577377bff9a06cf432 /js
parent216bc3d68b6a9016b3c5fdf90d82cbb291a28f96 (diff)
parent643effe382bb12b4ff1460e9e1987948b1763990 (diff)
downloadbootstrap-dae1a68fb15be9015760df32e85d764ef092db44.tar.xz
bootstrap-dae1a68fb15be9015760df32e85d764ef092db44.zip
Merge branch 'master' into derp
Conflicts: dist/css/bootstrap.css.map dist/css/bootstrap.min.css docs/_includes/components/navs.html docs/_includes/css/images.html docs/_includes/js/dropdowns.html docs/_includes/js/tabs.html docs/assets/css/docs.min.css docs/dist/css/bootstrap.css.map docs/dist/css/bootstrap.min.css
Diffstat (limited to 'js')
-rw-r--r--js/tests/unit/collapse.js4
-rw-r--r--js/tests/unit/tooltip.js16
-rw-r--r--js/tooltip.js2
3 files changed, 11 insertions, 11 deletions
diff --git a/js/tests/unit/collapse.js b/js/tests/unit/collapse.js
index 976bdcd7b..8e6bb8273 100644
--- a/js/tests/unit/collapse.js
+++ b/js/tests/unit/collapse.js
@@ -33,14 +33,14 @@ $(function () {
var $el = $('<div class="collapse"/>').bootstrapCollapse('show')
ok($el.hasClass('in'), 'has class "in"')
- ok(!/height/.test($el.attr('style')), 'has height reset')
+ ok(!/height/i.test($el.attr('style')), 'has height reset')
})
test('should hide a collapsed element', function () {
var $el = $('<div class="collapse"/>').bootstrapCollapse('hide')
ok(!$el.hasClass('in'), 'does not have class "in"')
- ok(/height/.test($el.attr('style')), 'has height set')
+ ok(/height/i.test($el.attr('style')), 'has height set')
})
test('should not fire shown when show is prevented', function () {
diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js
index a266b96ea..6871f538e 100644
--- a/js/tests/unit/tooltip.js
+++ b/js/tests/unit/tooltip.js
@@ -92,7 +92,7 @@ $(function () {
})
test('should allow html entities', function () {
- var $tooltip = $('<a href="#" rel="tooltip" title="<b>@fat</b>"/>')
+ var $tooltip = $('<a href="#" rel="tooltip" title="&lt;b&gt;@fat&lt;/b&gt;"/>')
.appendTo('#qunit-fixture')
.bootstrapTooltip({ html: true })
@@ -470,7 +470,7 @@ $(function () {
+ '.tooltip.right { white-space: nowrap; }'
+ '.tooltip.right .tooltip-inner { max-width: none; }'
+ '</style>'
- var $styles = $(styles).appendTo(document.head)
+ var $styles = $(styles).appendTo('head')
var $container = $('<div/>').appendTo(document.body)
var $target = $('<a href="#" rel="tooltip" title="very very very very very very very very long tooltip in one line"/>')
@@ -513,7 +513,7 @@ $(function () {
})
$tooltip.bootstrapTooltip('show')
- equal($('.tooltip').children('.tooltip-inner').text(), 'Simple tooltip', 'title is set from title attribute while prefered over title option')
+ equal($('.tooltip').children('.tooltip-inner').text(), 'Simple tooltip', 'title is set from title attribute while preferred over title option')
$tooltip.bootstrapTooltip('hide')
equal($('.tooltip').length, 0, 'tooltip removed from dom')
@@ -585,7 +585,7 @@ $(function () {
+ '.tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }'
+ 'a[rel="tooltip"] { position: fixed; }'
+ '</style>'
- var $styles = $(styles).appendTo(document.head)
+ var $styles = $(styles).appendTo('head')
var $container = $('<div/>').appendTo(document.body)
var $target = $('<a href="#" rel="tooltip" title="tip" style="top: 0px; left: 0px;"/>')
@@ -613,7 +613,7 @@ $(function () {
+ '.tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }'
+ 'a[rel="tooltip"] { position: fixed; }'
+ '</style>'
- var $styles = $(styles).appendTo(document.head)
+ var $styles = $(styles).appendTo('head')
var $container = $('<div/>').appendTo(document.body)
var $target = $('<a href="#" rel="tooltip" title="tip" style="bottom: 0px; left: 0px;"/>')
@@ -642,7 +642,7 @@ $(function () {
+ '.tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }'
+ 'a[rel="tooltip"] { position: fixed; }'
+ '</style>'
- var $styles = $(styles).appendTo(document.head)
+ var $styles = $(styles).appendTo('head')
var $container = $('<div/>').appendTo(document.body)
var $target = $('<a href="#" rel="tooltip" title="tip" style="top: 0px; left: 0px;"/>')
@@ -670,7 +670,7 @@ $(function () {
+ '.tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }'
+ 'a[rel="tooltip"] { position: fixed; }'
+ '</style>'
- var $styles = $(styles).appendTo(document.head)
+ var $styles = $(styles).appendTo('head')
var $container = $('<div/>').appendTo('body')
var $target = $('<a href="#" rel="tooltip" title="tip" style="top: 0px; right: 0px;"/>')
@@ -700,7 +700,7 @@ $(function () {
+ '.container-viewport { position: absolute; top: 50px; left: 60px; width: 300px; height: 300px; }'
+ 'a[rel="tooltip"] { position: fixed; }'
+ '</style>'
- var $styles = $(styles).appendTo(document.head)
+ var $styles = $(styles).appendTo('head')
var $container = $('<div class="container-viewport"/>').appendTo(document.body)
var $target = $('<a href="#" rel="tooltip" title="tip" style="top: 50px; left: 350px;"/>')
diff --git a/js/tooltip.js b/js/tooltip.js
index b305bc5ab..0c3a79d0b 100644
--- a/js/tooltip.js
+++ b/js/tooltip.js
@@ -321,7 +321,7 @@
var isBody = el.tagName == 'BODY'
var isSvg = window.SVGElement && el instanceof window.SVGElement
- var elRect = typeof el.getBoundingClientRect == 'function' ? el.getBoundingClientRect() : null
+ var elRect = el.getBoundingClientRect ? el.getBoundingClientRect() : null
var elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
var outerDims = isSvg ? {} : {