Browse Source

Implemented EventInfo#path for recording delegated events.

Aleksander Nowodzinski 9 years ago
parent
commit
e5a21cb8cf

+ 7 - 0
packages/ckeditor5-utils/src/eventinfo.js

@@ -27,6 +27,13 @@ export default class EventInfo {
 		 */
 		this.name = name;
 
+		/**
+		 * Path this event has followed. See {@link utils.EmitterMixin#delegate}.
+		 *
+		 * @member utils.EventInfo#path
+		 */
+		this.path = [];
+
 		// The following methods are defined in the constructor because they must be re-created per instance.
 
 		/**

+ 1 - 0
packages/ckeditor5-utils/tests/eventinfo.js

@@ -11,6 +11,7 @@ describe( 'EventInfo', () => {
 
 		expect( event.source ).to.equal( this );
 		expect( event.name ).to.equal( 'test' );
+		expect( event.path ).to.deep.equal( [] );
 		expect( event.stop.called ).to.not.be.true;
 		expect( event.off.called ).to.not.be.true;
 	} );