]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
replace $.bind() with $.on() in unit tests; per #13272
authorChris Rebert <code@rebertia.com>
Fri, 4 Apr 2014 01:13:16 +0000 (18:13 -0700)
committerChris Rebert <code@rebertia.com>
Fri, 4 Apr 2014 01:13:16 +0000 (18:13 -0700)
js/tests/unit/dropdown.js
js/tests/unit/modal.js

index 8597426cdeac32b3f940d6ce5458a24cfe5e8dfa..2d2e7c51db3a44e1db45be9fca44c1b5fab3fa3e 100644 (file)
@@ -169,10 +169,10 @@ $(function () {
 
     dropdown
       .parent('.dropdown')
-      .bind('show.bs.dropdown', function () {
+      .on('show.bs.dropdown', function () {
         ok(true, 'show was called')
       })
-      .bind('hide.bs.dropdown', function () {
+      .on('hide.bs.dropdown', function () {
         ok(true, 'hide was called')
         start()
       })
@@ -203,10 +203,10 @@ $(function () {
 
     dropdown
       .parent('.dropdown')
-      .bind('shown.bs.dropdown', function () {
+      .on('shown.bs.dropdown', function () {
         ok(true, 'show was called')
       })
-      .bind('hidden.bs.dropdown', function () {
+      .on('hidden.bs.dropdown', function () {
         ok(true, 'hide was called')
         start()
       })
index b026d18c49e9df31432790e0c3f6c357c12c5ffe..34912c2e9c9c059b721505faef73c0ec29b0b8b6 100644 (file)
@@ -140,13 +140,13 @@ $(function () {
     $.support.transition = false
     var div = $('<div id="modal-test"><div class="contents"></div></div>')
     div
-      .bind('shown.bs.modal', function () {
+      .on('shown.bs.modal', function () {
         ok($('#modal-test').length, 'modal insterted into dom')
         $('.contents').click()
         ok($('#modal-test').is(':visible'), 'modal visible')
         $('#modal-test').click()
       })
-      .bind('hidden.bs.modal', function () {
+      .on('hidden.bs.modal', function () {
         ok(!$('#modal-test').is(':visible'), 'modal hidden')
         div.remove()
         start()
@@ -162,11 +162,11 @@ $(function () {
     var div = $('<div id="modal-test"><div class="contents"></div></div>')
 
     div
-      .bind('shown.bs.modal', function () {
+      .on('shown.bs.modal', function () {
         triggered = 0
         $('#modal-test').click()
       })
-      .bind('hide.bs.modal', function () {
+      .on('hide.bs.modal', function () {
         triggered += 1
         ok(triggered === 1, 'modal hide triggered once')
         start()
@@ -179,7 +179,7 @@ $(function () {
     $.support.transition = false
     var div = $('<div id="modal-test"><div class="contents"><div id="close" data-dismiss="modal"></div></div></div>')
     div
-      .bind('shown.bs.modal', function () {
+      .on('shown.bs.modal', function () {
         $('#close').click()
         ok(!$('#modal-test').is(':visible'), 'modal hidden')
       })