8
0
Просмотр исходного кода

Added documentation for events.

fredck 10 лет назад
Родитель
Сommit
91251704bf

+ 14 - 0
packages/ckeditor5-utils/src/mvc/collection.js

@@ -101,3 +101,17 @@ CKEDITOR.define( [ 'emitter', 'utils' ], function( EmitterMixin, utils ) {
 
 	return Collection;
 } );
+
+/**
+ * Fired when an item is added to the collection.
+ a
+ * @event add
+ * @param {Model} model The added item.
+ */
+
+/**
+ * Fired when an item is removed from the collection.
+ *
+ * @event remove
+ * @param {Model} model The removed item.
+ */

+ 17 - 0
packages/ckeditor5-utils/src/mvc/model.js

@@ -92,3 +92,20 @@ CKEDITOR.define( [ 'emitter', 'utils' ], function( EmitterMixin, utils ) {
 
 	return Model;
 } );
+
+/**
+ * Fired when an attribute changed value.
+ *
+ * @event change
+ * @param {String} name The attribute name.
+ * @param {*} value The new attribute value.
+ * @param {*} oldValue The previous attribute value.
+ */
+
+/**
+ * Fired when an specific attribute changed value.
+ *
+ * @event change:{attribute}
+ * @param {*} value The new attribute value.
+ * @param {*} oldValue The previous attribute value.
+ */