Commit cafd750c authored by Martyn Smith's avatar Martyn Smith Committed by Martyn Smith
Browse files

upstream sync

parent c6fa8560
......@@ -497,9 +497,14 @@ MochiKit.Visual.Transitions.wobble = function (pos) {
};
/** @id MochiKit.Visual.Transitions.pulse */
MochiKit.Visual.Transitions.pulse = function (pos) {
return (Math.floor(pos*10) % 2 === 0 ?
(pos*10 - Math.floor(pos*10)) : 1 - (pos*10 - Math.floor(pos*10)));
MochiKit.Visual.Transitions.pulse = function (pos, pulses) {
if (!pulses) {
return (Math.floor(pos*10) % 2 === 0 ?
(pos*10 - Math.floor(pos*10)) : 1 - (pos*10 - Math.floor(pos*10)));
}
return (Math.round((pos % (1/pulses)) * pulses) == 0 ?
((pos * pulses * 2) - Math.floor(pos * pulses * 2)) :
1 - ((pos * pulses * 2) - Math.floor(pos * pulses * 2)));
};
/** @id MochiKit.Visual.Transitions.none */
......@@ -1874,7 +1879,7 @@ MochiKit.Visual.pulsate = function (element, /* optional */ options) {
}, options || {});
var transition = options.transition || v.Transitions.sinoidal;
var reverser = b.bind(function (pos) {
return transition(1 - v.Transitions.pulse(pos));
return transition(1 - v.Transitions.pulse(pos, options.pulses));
}, transition);
b.bind(reverser, transition);
return new v.Opacity(element, b.update({
......
Supports Markdown
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