Commit 8ca9f931 authored by Michał Gołębiowski's avatar Michał Gołębiowski Committed by Dave Methvin

bind/unbind changed to on/off in unit tests; refs #13554

parent f2cb5361
...@@ -1585,13 +1585,13 @@ module( "ajax", { ...@@ -1585,13 +1585,13 @@ module( "ajax", {
type: "POST" type: "POST"
}); });
jQuery( document ).bind( "ajaxStart ajaxStop", function() { jQuery( document ).on( "ajaxStart ajaxStop", function() {
ok( false, "Global event triggered" ); ok( false, "Global event triggered" );
}); });
jQuery("#qunit-fixture").append("<script src='data/evalScript.php'></script>"); jQuery("#qunit-fixture").append("<script src='data/evalScript.php'></script>");
jQuery( document ).unbind("ajaxStart ajaxStop"); jQuery( document ).off("ajaxStart ajaxStop");
}); });
asyncTest( "#11402 - jQuery.domManip() - script in comments are properly evaluated", 2, function() { asyncTest( "#11402 - jQuery.domManip() - script in comments are properly evaluated", 2, function() {
...@@ -1845,7 +1845,7 @@ module( "ajax", { ...@@ -1845,7 +1845,7 @@ module( "ajax", {
}); });
jQuery( document ).ajaxComplete(function( e, xml, s ) { jQuery( document ).ajaxComplete(function( e, xml, s ) {
strictEqual( s.dataType, "html", "Verify the load() dataType was html" ); strictEqual( s.dataType, "html", "Verify the load() dataType was html" );
jQuery( document ).unbind("ajaxComplete"); jQuery( document ).off("ajaxComplete");
start(); start();
}); });
jQuery("#first").load("data/test3.html"); jQuery("#first").load("data/test3.html");
......
...@@ -133,7 +133,7 @@ test("jQuery.data({})", 25, function() { ...@@ -133,7 +133,7 @@ test("jQuery.data({})", 25, function() {
test("jQuery.data(window)", 25, function() { test("jQuery.data(window)", 25, function() {
// remove bound handlers from window object to stop potential false positives caused by fix for #5280 in // remove bound handlers from window object to stop potential false positives caused by fix for #5280 in
// transports/xhr.js // transports/xhr.js
jQuery(window).unbind("unload"); jQuery(window).off("unload");
dataTests(window); dataTests(window);
}); });
...@@ -635,7 +635,7 @@ test(".removeData should not throw exceptions. (#10080)", function() { ...@@ -635,7 +635,7 @@ test(".removeData should not throw exceptions. (#10080)", function() {
expect(1); expect(1);
stop(); stop();
var frame = jQuery("#loadediframe"); var frame = jQuery("#loadediframe");
jQuery(frame[0].contentWindow).bind("unload", function() { jQuery(frame[0].contentWindow).on("unload", function() {
ok(true, "called unload"); ok(true, "called unload");
start(); start();
}); });
......
This diff is collapsed.
...@@ -172,8 +172,8 @@ var testWrap = function( val ) { ...@@ -172,8 +172,8 @@ var testWrap = function( val ) {
ok( true, "Event triggered." ); ok( true, "Event triggered." );
// Remove handlers on detached elements // Remove handlers on detached elements
result.unbind(); result.off();
jQuery(this).unbind(); jQuery(this).off();
}); });
j = jQuery("<span/>").wrap( result ); j = jQuery("<span/>").wrap( result );
...@@ -1960,7 +1960,7 @@ test( "Cloned, detached HTML5 elems (#10667,10670)", function() { ...@@ -1960,7 +1960,7 @@ test( "Cloned, detached HTML5 elems (#10667,10670)", function() {
} }
// Bind an event // Bind an event
$section.bind( "click", function( event ) { $section.on( "click", function( event ) {
ok( true, "clone fired event" ); ok( true, "clone fired event" );
}); });
...@@ -1969,7 +1969,7 @@ test( "Cloned, detached HTML5 elems (#10667,10670)", function() { ...@@ -1969,7 +1969,7 @@ test( "Cloned, detached HTML5 elems (#10667,10670)", function() {
// Trigger an event from the first clone // Trigger an event from the first clone
$clone.trigger("click"); $clone.trigger("click");
$clone.unbind("click"); $clone.off("click");
// Add a child node with text to the original // Add a child node with text to the original
$section.append("<p>Hello</p>"); $section.append("<p>Hello</p>");
...@@ -1981,7 +1981,7 @@ test( "Cloned, detached HTML5 elems (#10667,10670)", function() { ...@@ -1981,7 +1981,7 @@ test( "Cloned, detached HTML5 elems (#10667,10670)", function() {
// Trigger an event from the third clone // Trigger an event from the third clone
$clone.trigger("click"); $clone.trigger("click");
$clone.unbind("click"); $clone.off("click");
// Add attributes to copy // Add attributes to copy
$section.attr({ $section.attr({
...@@ -2008,8 +2008,8 @@ test( "Cloned, detached HTML5 elems (#10667,10670)", function() { ...@@ -2008,8 +2008,8 @@ test( "Cloned, detached HTML5 elems (#10667,10670)", function() {
$section.trigger("click"); $section.trigger("click");
// Unbind any remaining events // Unbind any remaining events
$section.unbind("click"); $section.off("click");
$clone.unbind("click"); $clone.off("click");
}); });
test( "Guard against exceptions when clearing safeChildNodes", function() { test( "Guard against exceptions when clearing safeChildNodes", function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment