Skip to content

Commit

Permalink
Merge pull request #6 from cgkineo/eventOrderFix
Browse files Browse the repository at this point in the history
Fix for landing on pip page and for cancelling navigation
  • Loading branch information
oliverfoster committed May 22, 2015
2 parents f5cd264 + 88dacf1 commit 1c2ef58
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions js/adapt-pageIncompletePrompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ define(function(require) {
_callbackEvent: "pageIncompletePrompt:" + event,
},{
promptText: model._buttons.no,
_callbackEvent: ""
_callbackEvent: "pageIncompletePrompt:cancel"
}],
_showIcon: true
}
Expand All @@ -60,13 +60,11 @@ define(function(require) {
model = Adapt.course.get(PLUGIN_NAME);
});

Adapt.on("router:page", function(pageView) {
if(isEnabled()) enableRouterNav(false);
});

Adapt.on("pageView:ready", function (){
var pageModel = Adapt.findById(Adapt.location._currentId);
pageComponents = pageModel.findDescendants("components").where({"_isAvailable": true});
if(isEnabled() && !allComponentsComplete()) enableRouterNav(false);
});

Adapt.on("pageIncompletePrompt:leavePage", function() {
Expand Down Expand Up @@ -95,4 +93,7 @@ define(function(require) {
Adapt.trigger("navigation:menuButton");
handlingRoute = false;
});
Adapt.on("pageIncompletePrompt:cancel", function() {
handlingRoute = false;
});
});

0 comments on commit 1c2ef58

Please sign in to comment.