eventinfo.js 852 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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( name ) {
  14. /**
  15. * The event name.
  16. */
  17. this.name = name;
  18. // The following methods are defined in the constructor because they must be re-created per instance.
  19. /**
  20. * Stops the event emitter to call further callbacks for this event interaction.
  21. *
  22. * @method
  23. */
  24. this.stop = utils.spy();
  25. /**
  26. * Removes the current callback from future interactions of this event.
  27. *
  28. * @method
  29. */
  30. this.off = utils.spy();
  31. }
  32. return EventInfo;
  33. } );