Only create multi categorize bubble for subscribe buttons upon hover.

This prevents creating a ton of bubble views on pages with lots of
subscribe buttons like /reddits/mine.
This commit is contained in:
Max Goodman
2013-06-05 15:57:09 -07:00
parent 47711af358
commit 4ab51600ef

View File

@@ -366,12 +366,21 @@ r.multi.MultiAddNoticeBubble = r.ui.Bubble.extend({
})
r.multi.SubscribeButton = Backbone.View.extend({
initialize: function() {
events: {
'mouseenter': 'createBubble'
},
createBubble: function() {
if (this.bubble) {
return
}
this.bubble = new r.multi.MultiSubscribeBubble({
parent: this.$el,
group: this.options.bubbleGroup,
srName: String(this.$el.data('sr_name'))
})
this.bubble.queueShow()
}
})