Merge branch 'develop' of github.com:martini/zammad into develop

This commit is contained in:
Martin Edenhofer 2015-11-12 15:31:22 +01:00
commit fc433fd649

View file

@ -66,7 +66,7 @@ do($ = window.jQuery, window) ->
@input = @el.find('.zammad-chat-input') @input = @el.find('.zammad-chat-input')
@el.find('.js-chat-open').click @open @el.find('.js-chat-open').click => @open()
@el.find('.js-chat-close').click @close @el.find('.js-chat-close').click @close
@el.find('.zammad-chat-controls').on 'submit', @onSubmit @el.find('.zammad-chat-controls').on 'submit', @onSubmit
@input.on @input.on
@ -146,9 +146,7 @@ do($ = window.jQuery, window) ->
@input.val unfinishedMessage @input.val unfinishedMessage
@show() @show()
@open @open()
showLoader: false
animate: false
if unfinishedMessage if unfinishedMessage
@input.focus() @input.focus()
@ -232,16 +230,16 @@ do($ = window.jQuery, window) ->
@el.find('.zammad-chat-body').append @view('message')(data) @el.find('.zammad-chat-body').append @view('message')(data)
@scrollToBottom() @scrollToBottom()
open: (options = { showLoader: true, animate: true }) => open: =>
return if @isOpen return if @isOpen
if options.showLoader if !@sessionId
@showLoader() @showLoader()
@el @el
.addClass('zammad-chat-is-open') .addClass('zammad-chat-is-open')
if options.animate if !@sessionId
@el.animate { bottom: 0 }, 500, @onOpenAnimationEnd @el.animate { bottom: 0 }, 500, @onOpenAnimationEnd
else else
@el.css 'bottom', 0 @el.css 'bottom', 0
@ -250,11 +248,8 @@ do($ = window.jQuery, window) ->
@isOpen = true @isOpen = true
onOpenAnimationEnd: => onOpenAnimationEnd: =>
#setTimeout @onQueue, 1180 if !@sessionId
# setTimeout @onConnectionEstablished, 1180 @session_init()
# setTimeout @onAgentTypingStart, 2000
# setTimeout @receiveMessage, 5000, "Hello! How can I help you?"
@session_init()
close: (event) => close: (event) =>
event.stopPropagation() if event event.stopPropagation() if event