浏览代码

Added: setter for RemoveOperation#_holderElementOffset and changed it to protected method.

Szymon Cofalik 9 年之前
父节点
当前提交
8d20174f05
共有 1 个文件被更改,包括 12 次插入2 次删除
  1. 12 2
      packages/ckeditor5-engine/src/model/operation/removeoperation.js

+ 12 - 2
packages/ckeditor5-engine/src/model/operation/removeoperation.js

@@ -39,9 +39,9 @@ export default class RemoveOperation extends MoveOperation {
 	}
 	}
 
 
 	/**
 	/**
-	 * Returns the offset of graveyard "holder" element, in which nodes removed by this operation are stored.
+	 * Offset of the graveyard "holder" element, in which nodes removed by this operation are stored.
 	 *
 	 *
-	 * @private
+	 * @protected
 	 * @type {Number}
 	 * @type {Number}
 	 */
 	 */
 	get _holderElementOffset() {
 	get _holderElementOffset() {
@@ -49,6 +49,16 @@ export default class RemoveOperation extends MoveOperation {
 	}
 	}
 
 
 	/**
 	/**
+	 * Sets {@link engine.model.operation.RemoveOperation#_holderElementOffset}.
+	 *
+	 * @protected
+	 * @param {Number} offset
+	 */
+	set _holderElementOffset( offset ) {
+		this.targetPosition.path[ 0 ] = offset;
+	}
+
+	/**
 	 * Flag informing whether this operation should insert "holder" element (`true`) or should remove nodes
 	 * Flag informing whether this operation should insert "holder" element (`true`) or should remove nodes
 	 * into existing "holder" element (`false`). It is `true` for each `RemoveOperation` that is the first `RemoveOperation`
 	 * into existing "holder" element (`false`). It is `true` for each `RemoveOperation` that is the first `RemoveOperation`
 	 * in it's delta which points to given holder element.
 	 * in it's delta which points to given holder element.