Skip to content

Commit

Permalink
Minor bug fix. When adding to an object a node that can neither be ed…
Browse files Browse the repository at this point in the history
…ited or is a collection, don't try to treat it like a collection.
  • Loading branch information
sderickson committed Aug 14, 2014
1 parent fbfee53 commit 3a2b13c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 23 deletions.
16 changes: 9 additions & 7 deletions dev/js/treema.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions src/core.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,14 @@ do __init = ->
else
@integrateChildTreema(newTreema)
# new treemas may already have children from default
children = newTreema.getChildren()
if children.length
newTreema.open()
child = newTreema.childrenTreemas[children[0][0]]
child.select()
else
newTreema.addNewChild()
if newTreema.collection
children = newTreema.getChildren()
if children.length
newTreema.open()
child = newTreema.childrenTreemas[children[0][0]]
child.select()
else
newTreema.addNewChild()

@addTrackedAction {'data':newTreema.data, 'path':newTreema.getPath(), 'parentPath':@getPath(), action:'insert'}
@updateMyAddButton()
Expand Down
20 changes: 11 additions & 9 deletions treema.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3a2b13c

Please sign in to comment.