Skip to content

Commit 459acb9

Browse files
committed
Room names added as unique. An error is now showed if an error occurred while creating a room. Updated backbone and underscore to latest versions
1 parent 8a0c6f6 commit 459acb9

File tree

5 files changed

+1230
-788
lines changed

5 files changed

+1230
-788
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ window.Kandan =
7070
initTabs: ()->
7171
$('#kandan').tabs({
7272
select: (event, ui)->
73+
if ui.tab.id == "create_channel" then return false
74+
7375
$(document).data('active-channel-id',
7476
Kandan.Helpers.Channels.getChannelIdByTabIndex(ui.index))
7577
Kandan.Data.Channels.runCallbacks('change')

app/assets/javascripts/backbone/views/channel_tabs.js.coffee

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ class Kandan.Views.ChannelTabs extends Backbone.View
3232
channel.save({}, {
3333
success: (model)->
3434
Kandan.Helpers.Channels.createChannelArea(model)
35+
36+
error: (model)->
37+
alert("Something went wrong while creating a new Room.\n\nMaybe the room name is already taken?")
3538
})
3639
console.log "create channel: #{channelName}"
3740
return false

0 commit comments

Comments
 (0)