goog.async.AnimationDelay
Classgoog.async.AnimationDelay
> goog.Disposable
goog.async.AnimationDelay(listener, opt_window, opt_handler)
A delayed callback that pegs to the next animation frame instead of a user configurable timeout. By design, this should have the same interface as goog.async.Delay. Uses requestAnimationFrame and friends when available, but falls back to a timeout of goog.async.AnimationDelay.TIMEOUT. For more on requestAnimationFrame and how you can use it to create smoother animations, see:
listener
{function
(number
)}
opt_window
{Window
=}
opt_handler
{Object
=}
.TIMEOUT
{number
}Default wait timeout for animations (in milliseconds). Only used for timed animation, which uses a timer (setTimeout) to schedule animation.
.addOnDisposeCallback(callback, opt_scope)
Inherited from goog.Disposable
.
Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.
callback
{!Function
}
opt_scope
{Object
=}
.creationStack
{string
}Inherited from goog.Disposable
.
If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.
.dispose()
Inherited from goog.Disposable
.
Disposes of the object. If the object hasn't already been disposed of, calls {@link #disposeInternal}. Classes that extend {@code goog.Disposable} should override {@link #disposeInternal} in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.
void
}
.disposeInternal()
[protected]Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend {@code goog.Disposable} should override this method. Not reentrant. To avoid calling it twice, it must only be called from the subclass' {@code disposeInternal} method. Everywhere else the public {@code dispose} method must be used. For example:
mypackage.MyClass = function() { goog.base(this); // Constructor logic specific to MyClass. ... }; goog.inherits(mypackage.MyClass, goog.Disposable); mypackage.MyClass.prototype.disposeInternal = function() { goog.base(this, 'disposeInternal'); // Dispose logic specific to MyClass. ... };
.fire()
Fires delay's action even if timer has already gone off or has not been started yet; guarantees action firing. Stops the delay timer.
.fireIfActive()
Fires delay's action only if timer is currently active. Stops the delay timer.
.getDisposed
[deprecated]Deprecated. Use {@link #isDisposed} instead.
Inherited from goog.Disposable
.
boolean
}
.isActive()
boolean
}
.isDisposed()
Inherited from goog.Disposable
.
boolean
}
.registerDisposable(disposable)
Inherited from goog.Disposable
.
Associates a disposable object with this object so that they will be disposed together.
disposable
{goog.disposable.IDisposable
}
.start()
Starts the delay timer. The provided listener function will be called before the next animation frame.
.stop()
Stops the delay timer if it is active. No action is taken if the timer is not in use.