Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
8ca9f931
Commit
8ca9f931
authored
Mar 04, 2013
by
Michał Gołębiowski
Committed by
Dave Methvin
Mar 26, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bind/unbind changed to on/off in unit tests; refs #13554
parent
f2cb5361
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
171 additions
and
173 deletions
+171
-173
ajax.js
test/unit/ajax.js
+3
-3
data.js
test/unit/data.js
+2
-2
event.js
test/unit/event.js
+159
-161
manipulation.js
test/unit/manipulation.js
+7
-7
No files found.
test/unit/ajax.js
View file @
8ca9f931
...
@@ -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"
);
...
...
test/unit/data.js
View file @
8ca9f931
...
@@ -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
();
});
});
...
...
test/unit/event.js
View file @
8ca9f931
This diff is collapsed.
Click to expand it.
test/unit/manipulation.js
View file @
8ca9f931
...
@@ -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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment