Skip to content

Commit

Permalink
Comment added
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark "Justin" Waks committed Dec 3, 2015
1 parent ba6deca commit bc23490
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/scala/org/querki/facades/jstree/JsTree.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ class JsTreeCommands(val tree:JsTree) extends AnyVal {
* In principle, we probably ought to also include versions with wider signatures, to be more general.
*/
class JsTreeEvents(val tree:JsTree) extends AnyVal {
/**
* Fires whenever the user selects a node. You can intercept this if you need to, eg, navigate instead
* of selecting.
*/
def onSelectNode(cb:JsTreeNode => Any):JsTree = {
tree.on("select_node.jstree", { (selected:dom.Element, evt:JQueryEventObject, data:Any) =>
val selectedNode = data.asInstanceOf[js.Dynamic].node.asInstanceOf[JsTreeNode]
Expand Down

0 comments on commit bc23490

Please sign in to comment.