mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
Selector parameter in findAncestor(s) is not optional
This commit is contained in:
parent
cc28960daa
commit
28700e1904
@ -1489,7 +1489,7 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
|
||||
* get all ancestors (parent then parent of the parent, etc) of the node
|
||||
* @method
|
||||
* @name Konva.Node#findAncestors
|
||||
* @param {String} [selector] selector for search
|
||||
* @param {String} selector selector for search
|
||||
* @param {Boolean} [includeSelf] show we think that node is ancestro itself?
|
||||
* @param {Konva.Node} [stopNode] optional node where we need to stop searching (one of ancestors)
|
||||
* @returns {Array} [ancestors]
|
||||
@ -1497,7 +1497,7 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
|
||||
* // get one of the parent group
|
||||
* var parentGroups = node.findAncestors('Group');
|
||||
*/
|
||||
findAncestors(selector?, includeSelf?, stopNode?) {
|
||||
findAncestors(selector, includeSelf?, stopNode?) {
|
||||
var res: Array<Node> = [];
|
||||
|
||||
if (includeSelf && this._isMatch(selector)) {
|
||||
@ -1522,7 +1522,7 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
|
||||
* get ancestor (parent or parent of the parent, etc) of the node that match passed selector
|
||||
* @method
|
||||
* @name Konva.Node#findAncestor
|
||||
* @param {String} [selector] selector for search
|
||||
* @param {String} selector selector for search
|
||||
* @param {Boolean} [includeSelf] show we think that node is ancestro itself?
|
||||
* @param {Konva.Node} [stopNode] optional node where we need to stop searching (one of ancestors)
|
||||
* @returns {Konva.Node} ancestor
|
||||
@ -1530,7 +1530,7 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
|
||||
* // get one of the parent group
|
||||
* var group = node.findAncestors('.mygroup');
|
||||
*/
|
||||
findAncestor(selector?, includeSelf?, stopNode?) {
|
||||
findAncestor(selector, includeSelf?, stopNode?) {
|
||||
return this.findAncestors(selector, includeSelf, stopNode)[0];
|
||||
}
|
||||
// is current node match passed selector?
|
||||
|
Loading…
Reference in New Issue
Block a user