API Docs for: 3.17.2
Show:

File: event/js/available.js

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