Skip to content

Commit b324222

Browse files
committedApr 11, 2012
fixed delete channel on new channel bug
1 parent e479f5a commit b324222

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed
 

‎app/assets/javascripts/backbone/kandan.js.coffee

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ window.Kandan =
6363
add: (event, ui) ->
6464
$('.header .ui-tabs-panel:last').detach().appendTo('#channels')
6565
$('#kandan').tabs('option', 'disabled', [])
66+
$('.header ul a').delegate('cite.close_channel', 'click', window.tabViewGlobal.deleteChannel)
6667
})
6768

6869
$("#kandan").tabs 'option', 'tabTemplate', '''

‎app/assets/javascripts/backbone/views/chatarea.js.coffee

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ class Kandan.Views.ChatArea extends Backbone.View
22

33
render: ->
44
tabView = new Kandan.Views.ChannelTabs({channels: @options.channels})
5+
window.tabViewGlobal = tabView
56
$('.header .logo').after(tabView.render().el)
67

78
# Binding tab events here, backbone can't properly attach
89
$('#create_channel').click(tabView.createChannel)
9-
$('.header ul a').delegate('.close_channel', 'click', tabView.deleteChannel)
10+
$('.header ul a').delegate('cite.close_channel', 'click', tabView.deleteChannel)
1011

1112
for channel in @options.channels.models
1213
view = new Kandan.Views.ChannelPane({channel: channel})

‎app/assets/templates/channel_tabs.jst.eco

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<% for channel in @channels.models: %>
22
<li>
3-
<a href="#<%= "channels-#{channel.get('id')}" %>">
3+
<a href="#<%= "channels-#{channel.get('id')}" %>" class="show_channel" >
44
<span class="tab_right"></span>
55
<span class="tab_left"></span>
66
<span class="tab_content">

0 commit comments

Comments
 (0)