... | ... |
@@ -20,6 +20,14 @@ class Xmpp.Views.Tabbar.TabbarView extends Backbone.View |
20 | 20 |
@closeTab(tab) if tab |
21 | 21 |
) |
22 | 22 |
|
23 |
+ Backbone.Events.on('removeContact', (contact) => |
|
24 |
+ tab = _.find(@tabs, (_tab) => |
|
25 |
+ _tab.model.get('withWhom') == contact |
|
26 |
+ ) |
|
27 |
+ |
|
28 |
+ Backbone.Events.trigger('closeChat', tab.model) |
|
29 |
+ ) |
|
30 |
+ |
|
23 | 31 |
@tabs = [] |
24 | 32 |
@activeTab = null |
25 | 33 |
@render() |