Skip to content

Commit

Permalink
set paliTextPath data attribute at 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 ca8c7ec commit 5c4c36e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libfrontend/treeview/treeview.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package treeview
import (
. "github.com/siongui/godom"
"github.com/siongui/gopalilib/lib"
"github.com/siongui/gopalilib/lib/tipitaka"
)

func traverseTreeviewData(tree lib.Tree, actionFunc func(lib.Tree)) *Object {
Expand Down Expand Up @@ -50,6 +51,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.SetInnerHTML(tree.Text)
span.AddEventListener("click", func(e Event) {
actionFunc(tree)
Expand Down

0 comments on commit 5c4c36e

Please sign in to comment.