mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-08-16 07:48:06 +02:00
import export tree done
This commit is contained in:
parent
aa9cfea3a4
commit
45aa088796
6 changed files with 262 additions and 34 deletions
|
@ -140,6 +140,7 @@ var MarkdownPresenter = ContainedBase.extend({
|
|||
|
||||
initialize: function(options) {
|
||||
options = options || {};
|
||||
this.deferred = options.deferred || Q.defer();
|
||||
this.JSON = {
|
||||
previewText: options.previewText || 'Here is something for you',
|
||||
fillerText: options.fillerText || '# Yay'
|
||||
|
@ -150,14 +151,25 @@ var MarkdownPresenter = ContainedBase.extend({
|
|||
});
|
||||
this.render();
|
||||
|
||||
var confirmCancel = new Views.ConfirmCancelView({
|
||||
destination: this.getDestination()
|
||||
});
|
||||
confirmCancel.deferred.promise
|
||||
.fail(function() { })
|
||||
.done(_.bind(this.die, this));
|
||||
if (!options.noConfirmCancel) {
|
||||
var confirmCancel = new Views.ConfirmCancelView({
|
||||
destination: this.getDestination()
|
||||
});
|
||||
confirmCancel.deferred.promise
|
||||
.then(_.bind(function() {
|
||||
this.deferred.resolve(this.grabText());
|
||||
}, this))
|
||||
.fail(_.bind(function() {
|
||||
this.deferred.reject();
|
||||
}, this))
|
||||
.done(_.bind(this.die, this));
|
||||
}
|
||||
|
||||
this.show();
|
||||
},
|
||||
|
||||
grabText: function() {
|
||||
return this.$('textarea').val();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -10,6 +10,9 @@ var LeftRightView = require('../views').LeftRightView;
|
|||
var ModalAlert = require('../views').ModalAlert;
|
||||
var GitDemonstrationView = require('../views/gitDemonstrationView').GitDemonstrationView;
|
||||
|
||||
var BuilderViews = require('../views/builderViews');
|
||||
var MarkdownPresenter = BuilderViews.MarkdownPresenter;
|
||||
|
||||
var KeyboardListener = require('../util/keyboard').KeyboardListener;
|
||||
var GitError = require('../util/errors').GitError;
|
||||
|
||||
|
@ -23,7 +26,8 @@ var MultiView = Backbone.View.extend({
|
|||
// a simple mapping of what childViews we support
|
||||
typeToConstructor: {
|
||||
ModalAlert: ModalAlert,
|
||||
GitDemonstrationView: GitDemonstrationView
|
||||
GitDemonstrationView: GitDemonstrationView,
|
||||
MarkdownPresenter: MarkdownPresenter
|
||||
},
|
||||
|
||||
initialize: function(options) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue