BALKANGraph / FamilyTreeJS

Build family tree app with BALKAN FamilyTreeJS library. Family Tree also called a genealogy or a pedigree chart, is a chart representing family relationships in a conventional tree structure.
50 stars 16 forks source link

Method signature mismatch: onUpdateNode() #43

Closed blavv closed 6 months ago

blavv commented 1 year ago

I was reading the source code of FamilyTreeJS (version 1.07.17) and found this:

(FamilyTree.prototype.onUpdateNode = function (e) { return this.on("update", function (t, i) { return e.call(t, i); }); })

and this near the end:

(FamilyTree.prototype.onUpdateNode = function (e) { return this.on("update", function (t, i, r) { var a = { oldData: i, newData: r }; return e.call(t, a); }); })

Your doc's method signature matches the former's:

https://balkan.app/FamilyTreeJS/API/classes/FamilyTree#onUpdateNode

but the latter overrides it in the actual code, calling onUpdateNode() with an arg with the extra layer "newData" and "oldData".

Which one of the above codes is the intended one?

ZornitsaPesheva commented 1 year ago

This is fixed in the latest version - 1.07.18