-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI Pack: Incorrect handling of defaults values #239
Comments
|
"Relax with your hyperbole" Sorry about that and not really sure what you mean, because English is not my native language. :(
You could chain the calls through the The last "bug" is related to the first. I fixed my copy of the library to pass-through Thinking as I write, maybe there is a clean way to fix those things: if you put a "Sequence" or "sub-queue" in the jQuery queue. That is: an object that is itself a queue of calls and which only dequeues when it is empty. |
Fixes CommonJS module loading. Closes #232. Closes #238. Allow animating with the raw utility function (Velocity) instead of its property (Velocity.animate), e.g. $.Velocity(element, propertiesMap, options); Copy over _cacheValues option for the UI pack. Closes #239. Reverts Velocity.mock to original (asynchronous) behavior. Closes #237. Fixes IE7 error throwing in UI pack. Closes #246.
Velocity consistently uses the
||
operator to set default values, like this:opt.easing = param.easing || 'ease';
.This is a bad JS habit, because it doesn't work when the value passed is falsy but not undefined (e.g.
false
or0
).I got biten by this bug here: https://github.com/julianshapiro/velocity/blob/master/velocity.ui.js#L83
opts.queue = sequenceOptions.queue || "";
This is wrong because the documentation says that passing the option
queue: false
executes the animation immediately. The code above in the UI pack silently ignores a passedfalse
option.A suggested fix is to use
$.extend
to set default values. Or in this case -- because you are white-listing the options you copy -- the longeropts.queue = sequenceOptions.queue !== undefined ? sequenceOptions.queue : "";
BTW I stumbled on two related bugs.
(1) The UI pack doesn't white-list (i.e. copy) the option
_cacheValues
any reason for that? It prevents using transitions on an element that you may have modified directly.(2) It is highly annoying that these options don't work:
{ stagger: 75, queue: false }
. The problem seems to be that not queuing bypasses everything in the queue including the delays created by theanimate
call itself! It would be a lot more useful ifqueue: false
bypasses everything else, with the exception of its own stuff!The text was updated successfully, but these errors were encountered: