From 91fed180be5a883970ad14f037832c482656d115 Mon Sep 17 00:00:00 2001 From: Max Goodman Date: Wed, 17 Jul 2013 23:40:27 -0700 Subject: [PATCH] When copying multis, pre-fill and select the name. --- r2/r2/public/static/js/multi.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/r2/r2/public/static/js/multi.js b/r2/r2/public/static/js/multi.js index 5e9525132..619266bb8 100644 --- a/r2/r2/public/static/js/multi.js +++ b/r2/r2/public/static/js/multi.js @@ -83,6 +83,10 @@ r.multi.MultiReddit = Backbone.Model.extend({ return this.uncreated }, + name: function() { + return this.get('path').split('/').pop() + }, + sync: function(method, model, options) { var res = Backbone.sync.apply(this, arguments) if (method == 'create') { @@ -316,7 +320,10 @@ r.multi.MultiDetails = Backbone.View.extend({ $copyForm .show() - .find('.multi-name').focus() + .find('.multi-name') + .val(this.model.name()) + .select() + .focus() this.copyForm = new r.multi.MultiCreateForm({ el: $copyForm,