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

fix for issue 45: added set() method for updating node items #46

Closed toshioue closed 1 year ago

toshioue commented 1 year ago

Added a set() method to familytree.js to address issue #45 :

The following lines of code were added/modified to familytree.js:

FamilyTree.prototype.set=function(e,i){for(const key in this.config.nodes[i]){if(this.config.nodes[i][key]!=e[key]){this.config.nodes[i][key]=e[key]}}return null}

,FamilyTree.prototype.update=function(e){for(var t=0;t<this.config.nodes.length;t++)if(this.config.nodes[t].id==e.id){this.set(e,t);break}return this}

The formatting of family.js may be slightly different.

ZornitsaPesheva commented 1 year ago

Thank you for the suggestion. did you mean Issue #45?

toshioue commented 1 year ago

Yes issue #45,

My apologies!

On Mon, Jan 16, 2023, 3:35 AM ZornitsaPesheva @.***> wrote:

Thank you for the suggestion. did you mean Issue #45 https://github.com/BALKANGraph/FamilyTreeJS/issues/45?

— Reply to this email directly, view it on GitHub https://github.com/BALKANGraph/FamilyTreeJS/pull/46#issuecomment-1383667248, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN3VW2RJB3ZHTSOXAHCXNUDWSUB6JANCNFSM6AAAAAAT4DQESQ . You are receiving this because you authored the thread.Message ID: @.***>

toshioue commented 1 year ago

I've updated the links to #45

ZornitsaPesheva commented 1 year ago

The issue #45 is fixed