mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-01 13:24:25 +01:00
all unit tests passing in ie7
This commit is contained in:
parent
81c128fd0b
commit
e61164e67a
10
js/bootstrap-alert.js
vendored
10
js/bootstrap-alert.js
vendored
@ -36,9 +36,15 @@
|
||||
|
||||
, close: function ( e ) {
|
||||
var $this = $(this)
|
||||
, selector = $this.attr('data-target') || $this.attr('href')
|
||||
, $parent = $(selector)
|
||||
, selector = $this.attr('data-target')
|
||||
, $parent
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||
}
|
||||
|
||||
$parent = $(selector)
|
||||
$parent.trigger('close')
|
||||
|
||||
e && e.preventDefault()
|
||||
|
4
js/bootstrap-carousel.js
vendored
4
js/bootstrap-carousel.js
vendored
@ -143,8 +143,8 @@
|
||||
|
||||
$(function () {
|
||||
$('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
|
||||
var $this = $(this)
|
||||
, $target = $($this.attr('data-target') || $this.attr('href'))
|
||||
var $this = $(this), href
|
||||
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||
, options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
|
||||
$target.carousel(options)
|
||||
e.preventDefault()
|
||||
|
6
js/bootstrap-collapse.js
vendored
6
js/bootstrap-collapse.js
vendored
@ -124,8 +124,10 @@
|
||||
|
||||
$(function () {
|
||||
$('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
|
||||
var $this = $(this)
|
||||
, target = $this.attr('data-target') || e.preventDefault() || $this.attr('href')
|
||||
var $this = $(this), href
|
||||
, target = $this.attr('data-target')
|
||||
|| e.preventDefault()
|
||||
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
||||
, option = $(target).data('collapse') ? 'toggle' : $this.data()
|
||||
$(target).collapse(option)
|
||||
})
|
||||
|
13
js/bootstrap-dropdown.js
vendored
13
js/bootstrap-dropdown.js
vendored
@ -36,11 +36,18 @@
|
||||
|
||||
, toggle: function ( e ) {
|
||||
var $this = $(this)
|
||||
, selector = $this.attr('data-target') || $this.attr('href')
|
||||
, $parent = $(selector)
|
||||
, selector = $this.attr('data-target')
|
||||
, $parent
|
||||
, isActive
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||
}
|
||||
|
||||
$parent = $(selector)
|
||||
$parent.length || ($parent = $this.parent())
|
||||
|
||||
isActive = $parent.hasClass('open')
|
||||
|
||||
clearMenus()
|
||||
@ -76,7 +83,7 @@
|
||||
* =================================== */
|
||||
|
||||
$(function () {
|
||||
$(window).on('click.dropdown.data-api', clearMenus)
|
||||
$('html').on('click.dropdown.data-api', clearMenus)
|
||||
$('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
||||
})
|
||||
|
||||
|
4
js/bootstrap-modal.js
vendored
4
js/bootstrap-modal.js
vendored
@ -193,8 +193,8 @@
|
||||
|
||||
$(function () {
|
||||
$('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
|
||||
var $this = $(this)
|
||||
, $target = $($this.attr('data-target') || $this.attr('href'))
|
||||
var $this = $(this), href
|
||||
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||
, option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
|
||||
|
||||
e.preventDefault()
|
||||
|
3
js/bootstrap-scrollspy.js
vendored
3
js/bootstrap-scrollspy.js
vendored
@ -27,10 +27,11 @@
|
||||
function ScrollSpy( element, options) {
|
||||
var process = $.proxy(this.process, this)
|
||||
, $element = $(element).is('body') ? $(window) : $(element)
|
||||
, href
|
||||
this.options = $.extend({}, $.fn.scrollspy.defaults, options)
|
||||
this.$scrollElement = $element.on('scroll.scroll.data-api', process)
|
||||
this.selector = (this.options.target
|
||||
|| $(element).attr('href')
|
||||
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||
|| '') + ' .nav li > a'
|
||||
this.$body = $('body').on('click.scroll.data-api', this.selector, process)
|
||||
this.refresh()
|
||||
|
13
js/bootstrap-tab.js
vendored
13
js/bootstrap-tab.js
vendored
@ -36,9 +36,14 @@
|
||||
, show: function () {
|
||||
var $this = this.element
|
||||
, $ul = $this.closest('ul:not(.dropdown-menu)')
|
||||
, href = $this.attr('data-target') || $this.attr('href')
|
||||
, selector = $this.attr('data-target')
|
||||
, previous
|
||||
, $href
|
||||
, $target
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||
}
|
||||
|
||||
if ( $this.parent('li').hasClass('active') ) return
|
||||
|
||||
@ -49,10 +54,10 @@
|
||||
, relatedTarget: previous
|
||||
})
|
||||
|
||||
$href = $(href)
|
||||
$target = $(selector)
|
||||
|
||||
this.activate($this.parent('li'), $ul)
|
||||
this.activate($href, $href.parent(), function () {
|
||||
this.activate($target, $target.parent(), function () {
|
||||
$this.trigger({
|
||||
type: 'shown'
|
||||
, relatedTarget: previous
|
||||
|
2
js/tests/unit/bootstrap-popover.js
vendored
2
js/tests/unit/bootstrap-popover.js
vendored
@ -82,7 +82,7 @@ $(function () {
|
||||
})
|
||||
|
||||
popover.popover('show')
|
||||
console.log(popover)
|
||||
|
||||
ok($('.popover').length, 'popover was inserted')
|
||||
ok($('.popover').hasClass('foobar'), 'custom class is present')
|
||||
|
||||
|
1
js/tests/unit/bootstrap-tab.js
vendored
1
js/tests/unit/bootstrap-tab.js
vendored
@ -17,7 +17,6 @@ $(function () {
|
||||
+ '<li><a href="#profile">Profile</a></li>'
|
||||
+ '</ul>'
|
||||
|
||||
|
||||
$('<ul><li id="home"></li><li id="profile"></li></ul>').appendTo("#qunit-fixture")
|
||||
|
||||
$(tabsHTML).find('li:last a').tab('show')
|
||||
|
2
js/tests/unit/bootstrap-transition.js
vendored
2
js/tests/unit/bootstrap-transition.js
vendored
@ -7,7 +7,7 @@ $(function () {
|
||||
})
|
||||
|
||||
test("should provide an end object", function () {
|
||||
ok($.support.transition.end, 'end string is defined')
|
||||
ok($.support.transition ? $.support.transition.end : true, 'end string is defined')
|
||||
})
|
||||
|
||||
})
|
Loading…
Reference in New Issue
Block a user