mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-01 18:24:28 +02:00
The confirmation dialog should not open after a user has solved the level and trying to see the solution
This commit is contained in:
parent
e169ed42a6
commit
82d5dfc7da
1 changed files with 25 additions and 19 deletions
|
@ -264,6 +264,7 @@ var Level = Sandbox.extend({
|
|||
var toIssue = this.level.solutionCommand;
|
||||
var issueFunc = function() {
|
||||
this.isShowingSolution = true;
|
||||
this.wasResetAfterSolved = true;
|
||||
Main.getEventBaton().trigger(
|
||||
'commandSubmitted',
|
||||
toIssue
|
||||
|
@ -281,6 +282,7 @@ var Level = Sandbox.extend({
|
|||
return;
|
||||
}
|
||||
|
||||
if(!LevelStore.isLevelSolved(this.level.id)){
|
||||
// allow them for force the solution
|
||||
var confirmDefer = Q.defer();
|
||||
var dialog = intl.getDialog(require('../dialogs/confirmShowSolution'))[0];
|
||||
|
@ -300,6 +302,10 @@ var Level = Sandbox.extend({
|
|||
command.finishWith(deferred);
|
||||
}, confirmView.getAnimationTime());
|
||||
});
|
||||
} else {
|
||||
issueFunc();
|
||||
command.finishWith(deferred);
|
||||
}
|
||||
},
|
||||
|
||||
toggleObjective: function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue