got rid of every underscore bind i think -- 1500 line diff

This commit is contained in:
Peter Cottle 2015-04-20 16:41:56 +10:00
parent 3833319476
commit 2257668f9d
21 changed files with 229 additions and 230 deletions

View file

@ -272,9 +272,9 @@ var LevelBuilder = Level.extend({
deferred: whenDoneEditing
});
whenDoneEditing.promise
.then(_.bind(function(levelObj) {
.then(function(levelObj) {
this.startDialogObj = levelObj;
}, this))
}.bind(this))
.fail(function() {
// nothing to do, they dont want to edit it apparently
})
@ -316,10 +316,10 @@ var LevelBuilder = Level.extend({
]
});
askForHintView.getPromise()
.then(_.bind(this.defineHint, this))
.fail(_.bind(function() {
.then(this.defineHint, this))
.fail(function() {
this.level.hint = {'en_US': ''};
}, this))
}.bind(this))
.done(function() {
askForHintDeferred.resolve();
});
@ -337,13 +337,13 @@ var LevelBuilder = Level.extend({
]
});
askForStartView.getPromise()
.then(_.bind(function() {
.then(function() {
// oh boy this is complex
var whenEditedDialog = Q.defer();
// the undefined here is the command that doesnt need resolving just yet...
this.editDialog(undefined, whenEditedDialog);
return whenEditedDialog.promise;
}, this))
}.bind(this))
.fail(function() {
// if they dont want to edit the start dialog, do nothing
})
@ -352,14 +352,14 @@ var LevelBuilder = Level.extend({
});
}
chain = chain.done(_.bind(function() {
chain = chain.done(function() {
// ok great! lets just give them the goods
new MarkdownPresenter({
fillerText: JSON.stringify(this.getExportObj(), null, 2),
previewText: intl.str('share-json')
});
command.finishWith(deferred);
}, this));
}.bind(this));
masterDeferred.resolve();
},