ValueChange Class
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);
});
});
Item Index
Methods
- _onBlur static
- _onFocus static
- _onKeyDown static
- _onKeyUp static
- _onMouseDown static
- _onSubscribe static
- _onUnsubscribe static
- _poll static
- _refreshTimeout static
- _startPolling static
- _stopPolling static
- _stopTimeout static
Properties
- POLL_INTERVAL static
- TIMEOUT static
Methods
_onBlur
-
e -
notifier
Stops polling when a node's blur event fires.
Parameters:
-
eEventFacade -
notifierSyntheticEvent.Notifier
_onFocus
-
e -
notifier
Resets a node's history and starts polling when a focus event occurs.
Parameters:
-
eEventFacade -
notifierSyntheticEvent.Notifier
_onKeyDown
-
e -
notifier
Starts polling when a node receives a keyDown event.
Parameters:
-
eEventFacade -
notifierSyntheticEvent.Notifier
_onKeyUp
-
e -
notifier
Starts polling when an IME-related keyUp event occurs on a node.
Parameters:
-
eEventFacade -
notifierSyntheticEvent.Notifier
_onMouseDown
-
e -
notifier
Starts polling when a node receives a mouseDown event.
Parameters:
-
eEventFacade -
notifierSyntheticEvent.Notifier
_onSubscribe
-
node -
sub -
notifier -
[filter]
Called when the valuechange event receives a new subscriber.
Parameters:
-
nodeNode -
subSubscription -
notifierSyntheticEvent.Notifier -
[filter]Function | String optionalFilter function or selector string. Only provided for delegate subscriptions.
_onUnsubscribe
-
node -
subscription -
notifier
Called when the valuechange event loses a subscriber.
Parameters:
-
nodeNode -
subscriptionSubscription -
notifierSyntheticEvent.Notifier
_poll
-
node -
options
Called at an interval to poll for changes to the value of the specified node.
Parameters:
-
nodeNodeNode to poll.
-
optionsObjectOptions object.
-
[e]EventFacade optionalEvent facade of the event that initiated the polling.
-
_refreshTimeout
-
node -
notifier
Restarts the inactivity timeout for the specified node.
Parameters:
-
nodeNodeNode to refresh.
-
notifierSyntheticEvent.Notifier
_startPolling
-
node -
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
Parameters:
-
nodeNodeNode to watch.
-
notifierSyntheticEvent.Notifier -
optionsObjectOptions object.
-
[e]EventFacade optionalEvent facade of the event that initiated the polling.
-
[force=false]Boolean optionalIf
true, polling will be restarted even if we're already polling this node.
-
_stopPolling
-
node -
[notifier]
Stops polling for changes to the specified node's value attribute.
Parameters:
-
nodeNodeNode to stop polling on.
-
[notifier]SyntheticEvent.Notifier optionalNotifier to remove from the node. If not specified, all notifiers will be removed.
_stopTimeout
-
node
Clears the inactivity timeout for the specified node, if any.
Parameters:
-
nodeNode
Properties
POLL_INTERVAL
Number
static
Interval (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
TIMEOUT
Number
static
Timeout (in milliseconds) after which to stop polling when there hasn't been any new activity (keypresses, mouse clicks, etc.) on an element.
Default: 10000
