Przeglądaj źródła

Added: parent property to model.DocumentFragment and view.DocumentFragment.

Szymon Cofalik 9 lat temu
rodzic
commit
595c288d09

+ 10 - 0
packages/ckeditor5-engine/src/model/documentfragment.js

@@ -84,6 +84,16 @@ export default class DocumentFragment {
 	}
 
 	/**
+	 * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.
+	 *
+	 * @readonly
+	 * @type {null}
+	 */
+	get parent() {
+		return null;
+	}
+
+	/**
 	 * Gets the child at the given index. Returns `null` if incorrect index was passed.
 	 *
 	 * @param {Number} index Index of child.

+ 10 - 0
packages/ckeditor5-engine/src/view/documentfragment.js

@@ -72,6 +72,16 @@ export default class DocumentFragment {
 	}
 
 	/**
+	 * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.
+	 *
+	 * @readonly
+	 * @type {null}
+	 */
+	get parent() {
+		return null;
+	}
+
+	/**
 	 * Returns ancestor elements of `DocumentFragment`, which is an empty array. Added for compatibility reasons.
 	 *
 	 * @returns {Array}