mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-11 16:14:04 +02:00
replace $.bind() with $.on() in unit tests; per #13272
This commit is contained in:
@@ -169,10 +169,10 @@ $(function () {
|
|||||||
|
|
||||||
dropdown
|
dropdown
|
||||||
.parent('.dropdown')
|
.parent('.dropdown')
|
||||||
.bind('show.bs.dropdown', function () {
|
.on('show.bs.dropdown', function () {
|
||||||
ok(true, 'show was called')
|
ok(true, 'show was called')
|
||||||
})
|
})
|
||||||
.bind('hide.bs.dropdown', function () {
|
.on('hide.bs.dropdown', function () {
|
||||||
ok(true, 'hide was called')
|
ok(true, 'hide was called')
|
||||||
start()
|
start()
|
||||||
})
|
})
|
||||||
@@ -203,10 +203,10 @@ $(function () {
|
|||||||
|
|
||||||
dropdown
|
dropdown
|
||||||
.parent('.dropdown')
|
.parent('.dropdown')
|
||||||
.bind('shown.bs.dropdown', function () {
|
.on('shown.bs.dropdown', function () {
|
||||||
ok(true, 'show was called')
|
ok(true, 'show was called')
|
||||||
})
|
})
|
||||||
.bind('hidden.bs.dropdown', function () {
|
.on('hidden.bs.dropdown', function () {
|
||||||
ok(true, 'hide was called')
|
ok(true, 'hide was called')
|
||||||
start()
|
start()
|
||||||
})
|
})
|
||||||
|
@@ -140,13 +140,13 @@ $(function () {
|
|||||||
$.support.transition = false
|
$.support.transition = false
|
||||||
var div = $('<div id="modal-test"><div class="contents"></div></div>')
|
var div = $('<div id="modal-test"><div class="contents"></div></div>')
|
||||||
div
|
div
|
||||||
.bind('shown.bs.modal', function () {
|
.on('shown.bs.modal', function () {
|
||||||
ok($('#modal-test').length, 'modal insterted into dom')
|
ok($('#modal-test').length, 'modal insterted into dom')
|
||||||
$('.contents').click()
|
$('.contents').click()
|
||||||
ok($('#modal-test').is(':visible'), 'modal visible')
|
ok($('#modal-test').is(':visible'), 'modal visible')
|
||||||
$('#modal-test').click()
|
$('#modal-test').click()
|
||||||
})
|
})
|
||||||
.bind('hidden.bs.modal', function () {
|
.on('hidden.bs.modal', function () {
|
||||||
ok(!$('#modal-test').is(':visible'), 'modal hidden')
|
ok(!$('#modal-test').is(':visible'), 'modal hidden')
|
||||||
div.remove()
|
div.remove()
|
||||||
start()
|
start()
|
||||||
@@ -162,11 +162,11 @@ $(function () {
|
|||||||
var div = $('<div id="modal-test"><div class="contents"></div></div>')
|
var div = $('<div id="modal-test"><div class="contents"></div></div>')
|
||||||
|
|
||||||
div
|
div
|
||||||
.bind('shown.bs.modal', function () {
|
.on('shown.bs.modal', function () {
|
||||||
triggered = 0
|
triggered = 0
|
||||||
$('#modal-test').click()
|
$('#modal-test').click()
|
||||||
})
|
})
|
||||||
.bind('hide.bs.modal', function () {
|
.on('hide.bs.modal', function () {
|
||||||
triggered += 1
|
triggered += 1
|
||||||
ok(triggered === 1, 'modal hide triggered once')
|
ok(triggered === 1, 'modal hide triggered once')
|
||||||
start()
|
start()
|
||||||
@@ -179,7 +179,7 @@ $(function () {
|
|||||||
$.support.transition = false
|
$.support.transition = false
|
||||||
var div = $('<div id="modal-test"><div class="contents"><div id="close" data-dismiss="modal"></div></div></div>')
|
var div = $('<div id="modal-test"><div class="contents"><div id="close" data-dismiss="modal"></div></div></div>')
|
||||||
div
|
div
|
||||||
.bind('shown.bs.modal', function () {
|
.on('shown.bs.modal', function () {
|
||||||
$('#close').click()
|
$('#close').click()
|
||||||
ok(!$('#modal-test').is(':visible'), 'modal hidden')
|
ok(!$('#modal-test').is(':visible'), 'modal hidden')
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user