Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Set tree view node placeholder only if node is valid #135

Merged
merged 1 commit into from
Aug 25, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/components/tree/treeviewcontroller.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ module.exports = class JTreeViewController extends KDViewController
nodeData[idPath] = "#{@getNodeId nodeData}"
nodeData[pIdPath] = if @getNodePId nodeData then "#{@getNodePId nodeData}" else "0"

@nodes[@getNodeId nodeData] = {}

if options.putDepthInfo
if @nodes[nodeData[pIdPath]]?.getData
nodeData.depth = @nodes[nodeData[pIdPath]].getData().depth + 1
Expand All @@ -117,6 +115,9 @@ module.exports = class JTreeViewController extends KDViewController
if nodeData[pIdPath] isnt "0" and not @nodes[nodeData[pIdPath]]
if options.addOrphansToRoot then nodeData[pIdPath] = "0" else nodeData = no

if nodeData
@nodes[@getNodeId nodeData] = {}

return nodeData

isNodeVisible:(nodeView)->
Expand Down