Skip to content

Commit

Permalink
Resolves #961, adds check on _canNavigate to navigateToParent()
Browse files Browse the repository at this point in the history
This makes it consistent with the other navigation functions.
  • Loading branch information
brian-learningpool committed Feb 18, 2016
1 parent 6045dc9 commit 5ec8d49
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/js/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,12 @@ define([
}
},

navigateToParent: function() {
var parentId = Adapt.contentObjects.findWhere({_id:Adapt.location._currentId}).get("_parentId");
var route = (parentId === Adapt.course.get("_id")) ? "#/" : "#/id/" + parentId;
this.navigate(route, { trigger: true });
navigateToParent: function(force) {
if (Adapt.router.get('_canNavigate') || force) {
var parentId = Adapt.contentObjects.findWhere({_id:Adapt.location._currentId}).get("_parentId");
var route = (parentId === Adapt.course.get("_id")) ? "#/" : "#/id/" + parentId;
this.navigate(route, { trigger: true });
}
},

setContentObjectToVisited: function(model) {
Expand Down

0 comments on commit 5ec8d49

Please sign in to comment.