Skip to content

Commit

Permalink
set action data attribute in leaf node of treeview
Browse files Browse the repository at this point in the history
  • Loading branch information
siongui committed Oct 25, 2023
1 parent 783375e commit 5a1af90
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libfrontend/treeview/treeview.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func traverseTreeviewData(tree lib.Tree, actionFunc func(lib.Tree)) *Object {
span := Document.CreateElement("span")
span.ClassList().Add("treeNode")
span.Dataset().Set("paliTextPath", tipitaka.ActionToPaliTextPath(tree.Action))
span.Dataset().Set("action", tree.Action)
span.SetInnerHTML(tree.Text)
span.AddEventListener("click", func(e Event) {
actionFunc(tree)
Expand Down

0 comments on commit 5a1af90

Please sign in to comment.