Skip to content

Commit

Permalink
Remote clients perform tab removal correctly for channel deletion (Fixes
Browse files Browse the repository at this point in the history
 #171).
  • Loading branch information
mjtko committed Mar 2, 2013
1 parent 0877f00 commit 0f823a0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/assets/javascripts/backbone/helpers/channels.js.coffee
Expand Up @@ -54,10 +54,12 @@ class Kandan.Helpers.Channels

@confirmAndDeleteChannel: (channel, tabIndex)->
return false if @confirmDeletion() == false
channel.destroy({success: ()=>
$("#kandan").tabs("remove", tabIndex)
})
channel.destroy {
success: ()=> #@removeChannelTab(tabIndex)
}

@removeChannelTab: (tabIndex)->
$("#kandan").tabs("remove", tabIndex)

@getChannelIdByTabIndex: (tabIndex)->
$("#kandan .ui-tabs-panel")
Expand All @@ -70,7 +72,7 @@ class Kandan.Helpers.Channels
@deleteChannelById: (channelId)->
if @channelExists(channelId)
tabIndex = @getTabIndexByChannelId(channelId)
@deleteChannelByTabIndex(tabIndex, true)
@removeChannelTab(tabIndex)

@deleteChannelByTabIndex: (tabIndex, deleted)->
# NOTE gotcha, 0 index being passed a natural index from the html views
Expand Down

0 comments on commit 0f823a0

Please sign in to comment.