Focus add subreddit box after multireddit creation.

This commit is contained in:
Max Goodman
2013-05-13 00:51:05 -07:00
parent 1cfd16ed97
commit 4ec9b5d43d

View File

@@ -8,12 +8,16 @@ r.multi = {
var detailsEl = $('.multi-details')
if (detailsEl.length) {
var multi = this.multis.touch(detailsEl.data('path'))
new r.multi.MultiDetails({
model: multi,
el: detailsEl
})
var multi = this.multis.touch(detailsEl.data('path')),
detailsView = new r.multi.MultiDetails({
model: multi,
el: detailsEl
})
multi.fetch()
if (location.hash == '#created') {
detailsView.focusAdd()
}
}
var subscribeBubbleGroup = {}
@@ -304,6 +308,10 @@ r.multi.MultiDetails = Backbone.View.extend({
window.location = '/'
}
})
},
focusAdd: function() {
this.$('.add-sr .sr-name').focus()
}
})
@@ -408,7 +416,7 @@ r.multi.ListingChooser = Backbone.View.extend({
r.multi.mine.create({name: name}, {
wait: true,
success: function(multi) {
window.location = multi.get('path')
window.location = multi.get('path') + '#created'
},
error: _.bind(function(multi, xhr) {
var resp = JSON.parse(xhr.responseText)