chat client: fix new session initiation
This commit is contained in:
parent
240d552339
commit
2b8bd3a87c
1 changed files with 6 additions and 11 deletions
|
@ -146,9 +146,7 @@ do($ = window.jQuery, window) ->
|
|||
@input.val unfinishedMessage
|
||||
|
||||
@show()
|
||||
@open
|
||||
showLoader: false
|
||||
animate: false
|
||||
@open()
|
||||
|
||||
if unfinishedMessage
|
||||
@input.focus()
|
||||
|
@ -232,16 +230,16 @@ do($ = window.jQuery, window) ->
|
|||
@el.find('.zammad-chat-body').append @view('message')(data)
|
||||
@scrollToBottom()
|
||||
|
||||
open: (options = { showLoader: true, animate: true }) =>
|
||||
open: =>
|
||||
return if @isOpen
|
||||
|
||||
if options.showLoader
|
||||
if !@sessionId
|
||||
@showLoader()
|
||||
|
||||
@el
|
||||
.addClass('zammad-chat-is-open')
|
||||
|
||||
if options.animate
|
||||
if !@sessionId
|
||||
@el.animate { bottom: 0 }, 500, @onOpenAnimationEnd
|
||||
else
|
||||
@el.css 'bottom', 0
|
||||
|
@ -250,11 +248,8 @@ do($ = window.jQuery, window) ->
|
|||
@isOpen = true
|
||||
|
||||
onOpenAnimationEnd: =>
|
||||
#setTimeout @onQueue, 1180
|
||||
# setTimeout @onConnectionEstablished, 1180
|
||||
# setTimeout @onAgentTypingStart, 2000
|
||||
# setTimeout @receiveMessage, 5000, "Hello! How can I help you?"
|
||||
@session_init()
|
||||
if !@sessionId
|
||||
@session_init()
|
||||
|
||||
close: (event) =>
|
||||
event.stopPropagation() if event
|
||||
|
|
Loading…
Reference in a new issue