mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-08-18 08:38:42 +02:00
next level and id refactor
This commit is contained in:
parent
d406317788
commit
f0a9c66056
8 changed files with 416 additions and 210 deletions
|
@ -367,7 +367,7 @@ var ConfirmCancelTerminal = Backbone.View.extend({
|
|||
var NextLevelConfirm = ConfirmCancelTerminal.extend({
|
||||
initialize: function(options) {
|
||||
options = options || {};
|
||||
this.nextLevelName = options.nextLevelName || 'The mysterious next level';
|
||||
var nextLevelName = (options.nextLevel) ? options.nextLevel.name : '';
|
||||
|
||||
var markdowns = [
|
||||
'## Great Job!!',
|
||||
|
@ -386,11 +386,18 @@ var NextLevelConfirm = ConfirmCancelTerminal.extend({
|
|||
);
|
||||
}
|
||||
|
||||
markdowns = markdowns.concat([
|
||||
'',
|
||||
'Would you like to move onto "',
|
||||
this.nextLevelName + '", the next level?'
|
||||
]);
|
||||
if (options.nextLevel) {
|
||||
markdowns = markdowns.concat([
|
||||
'',
|
||||
'Would you like to move onto "',
|
||||
nextLevelName + '", the next level?'
|
||||
]);
|
||||
} else {
|
||||
markdowns = markdowns.concat([
|
||||
'',
|
||||
'Wow!!! You finished the last level, congratulations!'
|
||||
]);
|
||||
}
|
||||
|
||||
options.modalAlert = {
|
||||
markdowns: markdowns
|
||||
|
|
|
@ -150,13 +150,8 @@ var LevelDropdownView = ContainedBase.extend({
|
|||
},
|
||||
|
||||
getSequenceIndex: function(name) {
|
||||
var index;
|
||||
_.each(this.sequences, function(_name, _index) {
|
||||
if (_name == name) {
|
||||
index = _index;
|
||||
}
|
||||
});
|
||||
if (index === undefined) { throw new Error('didnt find'); }
|
||||
var index = this.sequences.indexOf(name);
|
||||
if (index < 0) { throw new Error('didnt find'); }
|
||||
return index;
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue