浏览代码

Added documentation for events.

fredck 10 年之前
父节点
当前提交
91251704bf
共有 2 个文件被更改,包括 31 次插入0 次删除
  1. 14 0
      packages/ckeditor5-utils/src/mvc/collection.js
  2. 17 0
      packages/ckeditor5-utils/src/mvc/model.js

+ 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.
+ */