Show:
  1. /**
  2. * DOM event listener abstraction layer
  3. * @module event
  4. * @submodule event-base
  5. */
  6. /**
  7. * Executes the callback as soon as the specified element
  8. * is detected in the DOM. This function expects a selector
  9. * string for the element(s) to detect. If you already have
  10. * an element reference, you don't need this event.
  11. * @event available
  12. * @param type {string} 'available'
  13. * @param fn {function} the callback function to execute.
  14. * @param el {string} an selector for the element(s) to attach
  15. * @param context optional argument that specifies what 'this' refers to.
  16. * @param args* 0..n additional arguments to pass on to the callback function.
  17. * These arguments will be added after the event object.
  18. * @return {EventHandle} the detach handle
  19. * @for YUI
  20. */
  21. Y.Env.evt.plugins.available = {
  22. on: function(type, fn, id, o) {
  23. var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : null;
  24. return Y.Event.onAvailable.call(Y.Event, id, fn, o, a);
  25. }
  26. };
  27. /**
  28. * Executes the callback as soon as the specified element
  29. * is detected in the DOM with a nextSibling property
  30. * (indicating that the element's children are available).
  31. * This function expects a selector
  32. * string for the element(s) to detect. If you already have
  33. * an element reference, you don't need this event.
  34. * @event contentready
  35. * @param type {string} 'contentready'
  36. * @param fn {function} the callback function to execute.
  37. * @param el {string} an selector for the element(s) to attach.
  38. * @param context optional argument that specifies what 'this' refers to.
  39. * @param args* 0..n additional arguments to pass on to the callback function.
  40. * These arguments will be added after the event object.
  41. * @return {EventHandle} the detach handle
  42. * @for YUI
  43. */
  44. Y.Env.evt.plugins.contentready = {
  45. on: function(type, fn, id, o) {
  46. var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : null;
  47. return Y.Event.onContentReady.call(Y.Event, id, fn, o, a);
  48. }
  49. };