Skip to content

Commit

Permalink
fixed delete channel on new channel bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kevzettler committed Apr 11, 2012
1 parent e479f5a commit b324222
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/assets/javascripts/backbone/kandan.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ window.Kandan =
add: (event, ui) ->
$('.header .ui-tabs-panel:last').detach().appendTo('#channels')
$('#kandan').tabs('option', 'disabled', [])
$('.header ul a').delegate('cite.close_channel', 'click', window.tabViewGlobal.deleteChannel)
})

$("#kandan").tabs 'option', 'tabTemplate', '''
Expand Down
3 changes: 2 additions & 1 deletion app/assets/javascripts/backbone/views/chatarea.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ class Kandan.Views.ChatArea extends Backbone.View

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

# Binding tab events here, backbone can't properly attach
$('#create_channel').click(tabView.createChannel)
$('.header ul a').delegate('.close_channel', 'click', tabView.deleteChannel)
$('.header ul a').delegate('cite.close_channel', 'click', tabView.deleteChannel)

for channel in @options.channels.models
view = new Kandan.Views.ChannelPane({channel: channel})
Expand Down
2 changes: 1 addition & 1 deletion app/assets/templates/channel_tabs.jst.eco
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% for channel in @channels.models: %>
<li>
<a href="#<%= "channels-#{channel.get('id')}" %>">
<a href="#<%= "channels-#{channel.get('id')}" %>" class="show_channel" >
<span class="tab_right"></span>
<span class="tab_left"></span>
<span class="tab_content">
Expand Down

0 comments on commit b324222

Please sign in to comment.