1
0
Fork 0

feat(core): Make Part.getId() a prototype method

As requested by @BenJamesBen in #3282
This commit is contained in:
Joost De Cock 2022-12-22 19:35:14 +01:00
parent f6d8cdd7da
commit 1f51087c25

View file

@ -78,6 +78,17 @@ Part.prototype.attr = function (name, value, overwrite = false) {
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
*