eventinfo.js 935 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. /**
  7. * The event object passed to event callbacks. It is used to provide information about the event as well as a tool to
  8. * manipulate it.
  9. *
  10. * @class EventInfo
  11. */
  12. CKEDITOR.define( [ 'utils' ], function( utils ) {
  13. function EventInfo( source, name ) {
  14. /**
  15. * The object that fired the event.
  16. */
  17. this.source = source;
  18. /**
  19. * The event name.
  20. */
  21. this.name = name;
  22. // The following methods are defined in the constructor because they must be re-created per instance.
  23. /**
  24. * Stops the event emitter to call further callbacks for this event interaction.
  25. *
  26. * @method
  27. */
  28. this.stop = utils.spy();
  29. /**
  30. * Removes the current callback from future interactions of this event.
  31. *
  32. * @method
  33. */
  34. this.off = utils.spy();
  35. }
  36. return EventInfo;
  37. } );