Provides the implementation for the synthetic valuechange event. This class
isn't meant to be used directly, but is public to make monkeypatching possible.
Usage:
YUI().use('event-valuechange', function (Y) {
Y.one('#my-input').on('valuechange', function (e) {
Y.log('previous value: ' + e.prevVal);
Y.log('new value: ' + e.newVal);
});
});
_isEditablenode
Check to see if a node has editable content or not.
TODO: Add additional checks to get it to work for child nodes
that inherit "contenteditable" from parent nodes. This may be
too computationally intensive to be placed inside of the _poll
loop, however.
node
Node
_onBlure
notifier
Stops polling when a node's blur event fires.
e
EventFacade
notifier
SyntheticEvent.Notifier
_onFocuse
notifier
Resets a node's history and starts polling when a focus event occurs.
e
EventFacade
notifier
SyntheticEvent.Notifier
_onKeyDowne
notifier
Starts polling when a node receives a keyDown event.
e
EventFacade
notifier
SyntheticEvent.Notifier
_onKeyUpe
notifier
Starts polling when an IME-related keyUp event occurs on a node.
e
EventFacade
notifier
SyntheticEvent.Notifier
_onMouseDowne
notifier
Starts polling when a node receives a mouseDown event.
e
EventFacade
notifier
SyntheticEvent.Notifier
_onSubscribenode
sub
notifier
[filter]
Called when the valuechange event receives a new subscriber.
Child nodes that aren't initially available when this subscription is
called will still fire the valuechange event after their data is
collected when the delegated focus event is captured. This includes
elements that haven't been inserted into the DOM yet, as well as
elements that aren't initially contenteditable.
node
Node
sub
Subscription
notifier
SyntheticEvent.Notifier
[filter]
Function | String
optional
Filter function or selector string. Only provided for delegate subscriptions.
_onUnsubscribenode
subscription
notifier
Called when the valuechange event loses a subscriber.
node
Node
subscription
Subscription
notifier
SyntheticEvent.Notifier
_pollnode
options
Called at an interval to poll for changes to the value of the specified node.
node
Node
Node to poll.
options
Object
Options object.
[e]
EventFacade
optional
Event facade of the event that initiated the polling.
_refreshTimeoutnode
notifier
Restarts the inactivity timeout for the specified node.
node
Node
Node to refresh.
notifier
SyntheticEvent.Notifier
_startPollingnode
notifier
options
Begins polling for changes to the value property of the specified node. If
polling is already underway for the specified node, it will not be restarted
unless the force option is true
node
Node
Node to watch.
notifier
SyntheticEvent.Notifier
options
Object
Options object.
[e]
EventFacade
optional
Event facade of the event that initiated the polling.
[force=false]
Boolean
optional
If true, polling will be
restarted even if we're already polling this node.
_stopPollingnode
[notifier]
Stops polling for changes to the specified node's value attribute.
node
Node
Node to stop polling on.
[notifier]
SyntheticEvent.Notifier
optional
Notifier to remove from the node. If not specified, all notifiers will be removed.
_stopTimeoutnode
Clears the inactivity timeout for the specified node, if any.
node
Node
POLL_INTERVALInterval (in milliseconds) at which to poll for changes to the value of an
element with one or more valuechange subscribers when the user is likely
to be interacting with it.
Default: 50
TIMEOUTTimeout (in milliseconds) after which to stop polling when there hasn't been any new activity (keypresses, mouse clicks, etc.) on an element.
Default: 10000