feat(core): Make Part.getId() a prototype method
As requested by @BenJamesBen in #3282
This commit is contained in:
parent
f6d8cdd7da
commit
1f51087c25
1 changed files with 11 additions and 0 deletions
|
@ -78,6 +78,17 @@ Part.prototype.attr = function (name, value, overwrite = false) {
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a free ID to use in the part
|
||||||
|
*
|
||||||
|
* @return {string} id - A free ID to use
|
||||||
|
*/
|
||||||
|
Part.prototype.getId = function (prefix = '') {
|
||||||
|
this.freeId += 1
|
||||||
|
|
||||||
|
return prefix + this.freeId
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hide the part
|
* Hide the part
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue