We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e85730 commit 6d59c2fCopy full SHA for 6d59c2f
src/coffee/phrasebook/models/PresentationModel.coffee
@@ -14,8 +14,11 @@ class phrasebook.models.PresentationModel extends Backbone.Model
14
15
goBack: ->
16
@get('previouslyVisitedOptions').pop()
17
- lastOption = @get('previouslyVisitedOptions').last()
18
- @set('currentlyVisibleOptions', new Backbone.Collection(lastOption.get('children')))
+ if (@get('previouslyVisitedOptions').isEmpty())
+ @set('currentlyVisibleOptions', new Backbone.Collection(_.values(@tree)))
19
+ else
20
+ lastOption = @get('previouslyVisitedOptions').last()
21
+ @set('currentlyVisibleOptions', new Backbone.Collection(lastOption.get('children')))
22
23
parseJSONTree: (tree) ->
24
for nodeID, children of tree
0 commit comments