From 869885b2dbb8db31e809608845db33e5cc690fc3 Mon Sep 17 00:00:00 2001 From: Max Goodman Date: Tue, 11 Jun 2013 13:40:39 -0700 Subject: [PATCH] Only spawn MultiCreateForm once for the copy expando. --- r2/r2/public/static/js/multi.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/r2/r2/public/static/js/multi.js b/r2/r2/public/static/js/multi.js index dcac5e085..492e491d0 100644 --- a/r2/r2/public/static/js/multi.js +++ b/r2/r2/public/static/js/multi.js @@ -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() {