Node~event-set Class
Patches Y.Node to provide "set" events for attributes and styles similar
to the "change" events provided by Y.Attribute
. Simply subscribe to
_attr_Set or _style_Set, e.g., valueSet, z-indexSet, or classSet.
IMPORTANT: "set" events will ONLY fire if changes are made through
Y.Node
, NOT when directly operating on the DOM element. Also NOT when a
different sandbox operates on a separate Y.Node
instance for the same
element.
IMPORTANT: "set" events must be subscribed directly on the Y.Node
, not
via Y.on(...)
.
Note: The valuechange event provided by YUI captures all changes to the element's value attribute, but only when the element has focus.
To minimize the performance impact, this module initially overrides only Y.Node.on(). Patches are then applied to the appropriate functions on individual instances when a "set" event is requested.
- set, setAttrs, setAttribute, setStyle, setStyles
- Fires _attr_Set or _style_Set event with prevVal, newVal.
- setData,clearData
- Fires dataSet event with dataKey, prevVal, newVal.
- addClass, removeClass, replaceClass
- Fires classNameSet event with prevVal, newVal -- consistent with set('className', ...). Also includes addedClass or removedClass, as appropriate.
- setX, setY, setXY
- Fires xySet event with prevVal and newVal defining x, y, or both.