mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
ChatLeaveAction is now called on unloading
This commit is contained in:
parent
a7e6bab0cd
commit
409c6c068f
@ -64,6 +64,7 @@ consoleMock ?=
|
||||
# Binds all the events needed for Tims Chat.
|
||||
###
|
||||
bindEvents: () ->
|
||||
# Mark window as focused
|
||||
$(window).focus $.proxy () ->
|
||||
document.title = @titleTemplate.fetch
|
||||
title: $('#timsChatRoomList .activeMenuItem a').text()
|
||||
@ -71,10 +72,16 @@ consoleMock ?=
|
||||
@isActive = true
|
||||
, @
|
||||
|
||||
# Mark window as blurred
|
||||
$(window).blur $.proxy () ->
|
||||
@isActive = false
|
||||
, @
|
||||
|
||||
# Unload the chat
|
||||
$(window).unload $.proxy () ->
|
||||
@unload()
|
||||
, @
|
||||
|
||||
# Insert a smiley
|
||||
$('.smiley').click $.proxy (event) ->
|
||||
@insertText ' ' + $(event.target).attr('alt') + ' '
|
||||
@ -449,4 +456,11 @@ consoleMock ?=
|
||||
else
|
||||
li.addClass 'activeMenuItem'
|
||||
li.find('.timsChatUserMenu').wcfBlindIn 'vertical'
|
||||
###
|
||||
# Unloads the chat.
|
||||
###
|
||||
unload: () ->
|
||||
$.ajax @config.unloadURL,
|
||||
type: 'POST'
|
||||
async: false
|
||||
)(jQuery, @, consoleMock)
|
||||
|
@ -186,8 +186,7 @@
|
||||
// populate config
|
||||
TimWolla.WCF.Chat.config = {
|
||||
reloadTime: {@CHAT_RELOADTIME},
|
||||
animations: {@CHAT_ANIMATIONS},
|
||||
maxTextLength: {@CHAT_LENGTH}
|
||||
unloadURL: '{link controller='Chat' action='Leave'}{/link}'
|
||||
}
|
||||
WCF.Language.addObject({
|
||||
'wcf.chat.query': '{lang}wcf.chat.query{/lang}',
|
||||
|
Loading…
Reference in New Issue
Block a user