Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
stop(element, clearQueue){
Velocity(element,'stop',clearQueue);
this.isAnimating = false;
return this;
}
reverse(element){
Velocity(element,'reverse');
return this;
}
_adaptDimension: function(elt, dimension, have, want) {
if (have[dimension] === want[dimension]) {
return Promise.resolve();
}
var target = {};
target['outer'+capitalize(dimension)] = [
want[dimension],
have[dimension],
];
return Velocity(elt[0], target, {
duration: this._durationFor(have[dimension], want[dimension]),
queue: false,
easing: this.get('growEasing') || this.constructor.prototype.growEasing
});
},
rewind(element){
Velocity(name,'rewind');
return this;
}
//resolve selectors
if(typeof element === "string") element = this.container.querySelectorAll(element);
//if nothing was found or no element was passed resolve the promise immediatly
if(!element || element.length === 0) return Promise.resolve(element);
if(!silent) dispatch(element,"animateBegin");
if(typeof nameOrProps === "string"){
nameOrProps = this.resolveEffectAlias(nameOrProps);
//if(!nameOrProps) Promise.reject(new Error(`effect alias ${nameOrProps} not found`));
}
//try to run the animation
var opts = Object.assign({},this.options,options,overrides);
var p = Velocity(element, nameOrProps, opts);
//reject the promise if Velocity didn't return a Promise due to invalid arguments
if(!p) return Promise.reject(new Error("invalid element used for animator.animate"));
return p;
}
rewind(element){
Velocity(name,'rewind');
return this;
}
stop(element, clearQueue){
Velocity(element,'stop',clearQueue);
this.isAnimating = false;
return this;
}