|
@@ -247,14 +247,30 @@ export default class DocumentSelection {
|
|
|
* <paragraph>b</paragraph>
|
|
* <paragraph>b</paragraph>
|
|
|
* <paragraph>]c</paragraph> // this block will not be returned
|
|
* <paragraph>]c</paragraph> // this block will not be returned
|
|
|
*
|
|
*
|
|
|
- * @returns {Iterator.<module:engine/model/element~Element>}
|
|
|
|
|
|
|
+ * @returns {Iterable.<module:engine/model/element~Element>}
|
|
|
*/
|
|
*/
|
|
|
getSelectedBlocks() {
|
|
getSelectedBlocks() {
|
|
|
return this._selection.getSelectedBlocks();
|
|
return this._selection.getSelectedBlocks();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- getTopMostBlocks( schema ) {
|
|
|
|
|
- return this._selection.getTopMostBlocks( schema );
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns blocks that aren't nested in other selected blocks.
|
|
|
|
|
+ *
|
|
|
|
|
+ * In this case the method will return blocks A, B and E because C & D are children of block B:
|
|
|
|
|
+ *
|
|
|
|
|
+ * [<blockA></blockA>
|
|
|
|
|
+ * <blockB>
|
|
|
|
|
+ * <blockC></blockC>
|
|
|
|
|
+ * <blockD></blockD>
|
|
|
|
|
+ * </blockB>
|
|
|
|
|
+ * <blockE></blockE>]
|
|
|
|
|
+ *
|
|
|
|
|
+ * **Note:** To get all selected blocks use {@link #getSelectedBlocks `getSelectedBlocks()`}.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @returns {Iterable.<module:engine/model/element~Element>}
|
|
|
|
|
+ */
|
|
|
|
|
+ getTopMostBlocks() {
|
|
|
|
|
+ return this._selection.getTopMostBlocks();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|