});\r
},\r
nickClick: function (x) {\r
- var target = $(x.currentTarget).parent('li'),\r
- member = target.data('member'),\r
- userbox = new _kiwi.view.UserBox();\r
+ var $target = $(x.currentTarget).parent('li'),\r
+ member = $target.data('member'),\r
+ userbox;\r
\r
+ // If the userbox already exists here, hide it\r
+ if ($target.find('.userbox').length > 0) {\r
+ $('.userbox', this.$el).remove();\r
+ return;\r
+ }\r
+\r
+ userbox = new _kiwi.view.UserBox();\r
userbox.member = member;\r
+\r
+ // Remove any existing userboxes\r
$('.userbox', this.$el).remove();\r
- target.append(userbox.$el);\r
+ \r
+ $target.append(userbox.$el);\r
},\r
show: function () {\r
$('#memberlists').children().removeClass('active');\r