Only spawn MultiCreateForm once for the copy expando.

This commit is contained in:
Max Goodman
2013-06-11 13:40:39 -07:00
parent 2ed755e8c5
commit 869885b2db

View File

@@ -327,17 +327,19 @@ r.multi.MultiDetails = Backbone.View.extend({
.select()
.focus()
this.copyForm = new r.multi.MultiCreateForm({
el: $copyForm,
navOnCreate: true,
createMulti: _.bind(function(name) {
var newMulti = new r.multi.MultiReddit({
path: r.multi.mine.pathByName(name)
}, {isNew: true})
this.model.copyTo(newMulti)
return newMulti
}, this)
})
if (!this.copyForm) {
this.copyForm = new r.multi.MultiCreateForm({
el: $copyForm,
navOnCreate: true,
createMulti: _.bind(function(name) {
var newMulti = new r.multi.MultiReddit({
path: r.multi.mine.pathByName(name)
}, {isNew: true})
this.model.copyTo(newMulti)
return newMulti
}, this)
})
}
},
deleteMulti: function() {