store methods don't become properties on shorthand
This commit is contained in:
parent
aaa25b76f3
commit
49748a7c00
25 changed files with 95 additions and 80 deletions
|
@ -135,15 +135,6 @@ Part.prototype.shorthand = function () {
|
|||
utils: utils,
|
||||
Bezier: Bezier,
|
||||
}
|
||||
// Add top-level store methods and add a part name parameter
|
||||
const partName = this.name
|
||||
for (const [key, method] of Object.entries(this.context.store)) {
|
||||
if (typeof method === 'function')
|
||||
shorthand[key] = function (...args) {
|
||||
return method(partName, ...args)
|
||||
}
|
||||
}
|
||||
|
||||
// We'll need this
|
||||
let self = this
|
||||
|
||||
|
|
|
@ -160,6 +160,7 @@ Pattern.prototype.createPartForSet = function (partName, set = 0) {
|
|||
Pattern.prototype.draftPartForSet = function (partName, set) {
|
||||
if (typeof this.config.parts?.[partName]?.draft === 'function') {
|
||||
this.activePart = partName
|
||||
this.setStores[set].set('activePart', partName)
|
||||
try {
|
||||
this.__runHooks('prePartDraft')
|
||||
const result = this.config.parts[partName].draft(this.parts[set][partName].shorthand())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue