Skip to content

Commit

Permalink
Merge pull request #962 from adaptlearning/issue/961
Browse files Browse the repository at this point in the history
Resolves #961, adds check on _canNavigate to navigateToParent()
  • Loading branch information
brian-learningpool committed Feb 18, 2016
2 parents 7b25656 + 5ec8d49 commit 52253f0
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 52253f0

Please sign in to comment.