mirror of
https://github.com/twbs/bootstrap.git
synced 2025-03-15 15:29:22 +01:00
Merge pull request #14090 from hnrch02/unit-tests-ie8
Fix IE8 problems with unit tests
This commit is contained in:
commit
42fbcfdaef
@ -33,14 +33,14 @@ $(function () {
|
|||||||
var $el = $('<div class="collapse"/>').bootstrapCollapse('show')
|
var $el = $('<div class="collapse"/>').bootstrapCollapse('show')
|
||||||
|
|
||||||
ok($el.hasClass('in'), 'has class "in"')
|
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 () {
|
test('should hide a collapsed element', function () {
|
||||||
var $el = $('<div class="collapse"/>').bootstrapCollapse('hide')
|
var $el = $('<div class="collapse"/>').bootstrapCollapse('hide')
|
||||||
|
|
||||||
ok(!$el.hasClass('in'), 'does not have class "in"')
|
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 () {
|
test('should not fire shown when show is prevented', function () {
|
||||||
|
@ -470,7 +470,7 @@ $(function () {
|
|||||||
+ '.tooltip.right { white-space: nowrap; }'
|
+ '.tooltip.right { white-space: nowrap; }'
|
||||||
+ '.tooltip.right .tooltip-inner { max-width: none; }'
|
+ '.tooltip.right .tooltip-inner { max-width: none; }'
|
||||||
+ '</style>'
|
+ '</style>'
|
||||||
var $styles = $(styles).appendTo(document.head)
|
var $styles = $(styles).appendTo('head')
|
||||||
|
|
||||||
var $container = $('<div/>').appendTo(document.body)
|
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"/>')
|
var $target = $('<a href="#" rel="tooltip" title="very very very very very very very very long tooltip in one line"/>')
|
||||||
@ -585,7 +585,7 @@ $(function () {
|
|||||||
+ '.tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }'
|
+ '.tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }'
|
||||||
+ 'a[rel="tooltip"] { position: fixed; }'
|
+ 'a[rel="tooltip"] { position: fixed; }'
|
||||||
+ '</style>'
|
+ '</style>'
|
||||||
var $styles = $(styles).appendTo(document.head)
|
var $styles = $(styles).appendTo('head')
|
||||||
|
|
||||||
var $container = $('<div/>').appendTo(document.body)
|
var $container = $('<div/>').appendTo(document.body)
|
||||||
var $target = $('<a href="#" rel="tooltip" title="tip" style="top: 0px; left: 0px;"/>')
|
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; }'
|
+ '.tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }'
|
||||||
+ 'a[rel="tooltip"] { position: fixed; }'
|
+ 'a[rel="tooltip"] { position: fixed; }'
|
||||||
+ '</style>'
|
+ '</style>'
|
||||||
var $styles = $(styles).appendTo(document.head)
|
var $styles = $(styles).appendTo('head')
|
||||||
|
|
||||||
var $container = $('<div/>').appendTo(document.body)
|
var $container = $('<div/>').appendTo(document.body)
|
||||||
var $target = $('<a href="#" rel="tooltip" title="tip" style="bottom: 0px; left: 0px;"/>')
|
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; }'
|
+ '.tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }'
|
||||||
+ 'a[rel="tooltip"] { position: fixed; }'
|
+ 'a[rel="tooltip"] { position: fixed; }'
|
||||||
+ '</style>'
|
+ '</style>'
|
||||||
var $styles = $(styles).appendTo(document.head)
|
var $styles = $(styles).appendTo('head')
|
||||||
|
|
||||||
var $container = $('<div/>').appendTo(document.body)
|
var $container = $('<div/>').appendTo(document.body)
|
||||||
var $target = $('<a href="#" rel="tooltip" title="tip" style="top: 0px; left: 0px;"/>')
|
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; }'
|
+ '.tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }'
|
||||||
+ 'a[rel="tooltip"] { position: fixed; }'
|
+ 'a[rel="tooltip"] { position: fixed; }'
|
||||||
+ '</style>'
|
+ '</style>'
|
||||||
var $styles = $(styles).appendTo(document.head)
|
var $styles = $(styles).appendTo('head')
|
||||||
|
|
||||||
var $container = $('<div/>').appendTo('body')
|
var $container = $('<div/>').appendTo('body')
|
||||||
var $target = $('<a href="#" rel="tooltip" title="tip" style="top: 0px; right: 0px;"/>')
|
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; }'
|
+ '.container-viewport { position: absolute; top: 50px; left: 60px; width: 300px; height: 300px; }'
|
||||||
+ 'a[rel="tooltip"] { position: fixed; }'
|
+ 'a[rel="tooltip"] { position: fixed; }'
|
||||||
+ '</style>'
|
+ '</style>'
|
||||||
var $styles = $(styles).appendTo(document.head)
|
var $styles = $(styles).appendTo('head')
|
||||||
|
|
||||||
var $container = $('<div class="container-viewport"/>').appendTo(document.body)
|
var $container = $('<div class="container-viewport"/>').appendTo(document.body)
|
||||||
var $target = $('<a href="#" rel="tooltip" title="tip" style="top: 50px; left: 350px;"/>')
|
var $target = $('<a href="#" rel="tooltip" title="tip" style="top: 50px; left: 350px;"/>')
|
||||||
|
@ -321,7 +321,7 @@
|
|||||||
var isBody = el.tagName == 'BODY'
|
var isBody = el.tagName == 'BODY'
|
||||||
var isSvg = window.SVGElement && el instanceof window.SVGElement
|
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 elOffset = isBody ? { top: 0, left: 0 } : $element.offset()
|
||||||
var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
|
var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
|
||||||
var outerDims = isSvg ? {} : {
|
var outerDims = isSvg ? {} : {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user