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
516a7a87
Commit
516a7a87
authored
Nov 08, 2012
by
Corey Frang
Committed by
Dave Methvin
Nov 25, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #12803. Add jQuery.fx.start as a hook point. Close gh-1024.
parent
84629a9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
effects.js
src/effects.js
+8
-2
effects.js
test/unit/effects.js
+27
-0
No files found.
src/effects.js
View file @
516a7a87
...
@@ -640,13 +640,19 @@ jQuery.fx.tick = function() {
...
@@ -640,13 +640,19 @@ jQuery.fx.tick = function() {
};
};
jQuery
.
fx
.
timer
=
function
(
timer
)
{
jQuery
.
fx
.
timer
=
function
(
timer
)
{
if
(
timer
()
&&
jQuery
.
timers
.
push
(
timer
)
&&
!
timerId
)
{
if
(
timer
()
&&
jQuery
.
timers
.
push
(
timer
)
)
{
timerId
=
setInterval
(
jQuery
.
fx
.
tick
,
jQuery
.
fx
.
interval
);
jQuery
.
fx
.
start
(
);
}
}
};
};
jQuery
.
fx
.
interval
=
13
;
jQuery
.
fx
.
interval
=
13
;
jQuery
.
fx
.
start
=
function
()
{
if
(
!
timerId
)
{
timerId
=
setInterval
(
jQuery
.
fx
.
tick
,
jQuery
.
fx
.
interval
);
}
};
jQuery
.
fx
.
stop
=
function
()
{
jQuery
.
fx
.
stop
=
function
()
{
clearInterval
(
timerId
);
clearInterval
(
timerId
);
timerId
=
null
;
timerId
=
null
;
...
...
test/unit/effects.js
View file @
516a7a87
...
@@ -1877,4 +1877,31 @@ jQuery.map([ "toggle", "slideToggle", "fadeToggle" ], function ( method ) {
...
@@ -1877,4 +1877,31 @@ jQuery.map([ "toggle", "slideToggle", "fadeToggle" ], function ( method ) {
});
});
});
});
test
(
"jQuery.fx.start & jQuery.fx.stop hook points"
,
function
()
{
var
oldStart
=
jQuery
.
fx
.
start
,
oldStop
=
jQuery
.
fx
.
stop
,
foo
=
jQuery
({
foo
:
0
});
expect
(
3
);
jQuery
.
fx
.
start
=
function
()
{
ok
(
true
,
"start called"
);
};
jQuery
.
fx
.
stop
=
function
()
{
ok
(
true
,
"stop called"
);
};
// calls start
foo
.
animate
({
foo
:
1
},
{
queue
:
false
});
// calls start
foo
.
animate
({
foo
:
2
},
{
queue
:
false
});
foo
.
stop
();
// calls stop
jQuery
.
fx
.
tick
();
// cleanup
jQuery
.
fx
.
start
=
oldStart
;
jQuery
.
fx
.
stop
=
oldStop
;
});
}
// if ( jQuery.fx )
}
// if ( jQuery.fx )
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