chat client: fix merge

This commit is contained in:
Felix Niklas 2015-11-12 15:05:43 +01:00
parent 27ebc6a0a6
commit 77aeb271f8
3 changed files with 600 additions and 504 deletions

View file

@ -133,6 +133,8 @@ do($ = window.jQuery, window) ->
@show() @show()
openSession: (session) => openSession: (session) =>
unfinishedMessage = sessionStorage.getItem 'unfinished_message'
for message in session for message in session
console.log "message in session", message console.log "message in session", message
@renderMessage @renderMessage
@ -140,14 +142,17 @@ do($ = window.jQuery, window) ->
id: message.id id: message.id
from: if message.created_by_id then 'agent' else 'customer' from: if message.created_by_id then 'agent' else 'customer'
if sessionStorage.getItem 'unfinished_message' if unfinishedMessage
@input.val( sessionStorage.getItem('unfinished_message') ).focus() @input.val unfinishedMessage
@show() @show()
@open @open
showLoader: false showLoader: false
animate: false animate: false
if unfinishedMessage
@input.focus()
onInput: => onInput: =>
# remove unread-state from messages # remove unread-state from messages
@el.find('.zammad-chat-message--unread') @el.find('.zammad-chat-message--unread')
@ -199,7 +204,7 @@ do($ = window.jQuery, window) ->
@lastAddedType = 'message--customer' @lastAddedType = 'message--customer'
@el.find('.zammad-chat-body').append messageElement @el.find('.zammad-chat-body').append messageElement
@el.find('.zammad-chat-input').val('') @input.val('')
@scrollToBottom() @scrollToBottom()
@isTyping = false @isTyping = false
@ -283,15 +288,15 @@ do($ = window.jQuery, window) ->
@el.css 'bottom', -remainerHeight @el.css 'bottom', -remainerHeight
@el.find('.zammad-chat-input').autoGrow @input.autoGrow
extraLine: false extraLine: false
disableInput: -> disableInput: ->
@el.find('.zammad-chat-input').prop('disabled', true) @input.prop('disabled', true)
@el.find('.zammad-chat-send').prop('disabled', true) @el.find('.zammad-chat-send').prop('disabled', true)
enableInput: -> enableInput: ->
@el.find('.zammad-chat-input').prop('disabled', false) @input.prop('disabled', false)
@el.find('.zammad-chat-send').prop('disabled', false) @el.find('.zammad-chat-send').prop('disabled', false)
onQueueScreen: (data) => onQueueScreen: (data) =>
@ -423,11 +428,15 @@ do($ = window.jQuery, window) ->
@el.find('.zammad-chat-agent').addClass('zammad-chat-is-hidden') @el.find('.zammad-chat-agent').addClass('zammad-chat-is-hidden')
@el.find('.zammad-chat-agent-status').addClass('zammad-chat-is-hidden') @el.find('.zammad-chat-agent-status').addClass('zammad-chat-is-hidden')
onConnectionEstablished: (agent) => setSessionId: (id) =>
@sessionId = id
sessionStorage.setItem 'sessionId', id
onConnectionEstablished: (data) =>
# stop delay of initial queue position # stop delay of initial queue position
if @onInitialQueueDelayId if @onInitialQueueDelayId
clearTimeout(@onInitialQueueDelayId) clearTimeout @onInitialQueueDelayId
@inQueue = false @inQueue = false
@agent = data.agent @agent = data.agent
@ -442,7 +451,7 @@ do($ = window.jQuery, window) ->
@el.find('.zammad-chat-welcome').addClass('zammad-chat-is-hidden') @el.find('.zammad-chat-welcome').addClass('zammad-chat-is-hidden')
@el.find('.zammad-chat-agent').removeClass('zammad-chat-is-hidden') @el.find('.zammad-chat-agent').removeClass('zammad-chat-is-hidden')
@el.find('.zammad-chat-agent-status').removeClass('zammad-chat-is-hidden') @el.find('.zammad-chat-agent-status').removeClass('zammad-chat-is-hidden')
@el.find('.zammad-chat-input').focus() @input.focus()
showLoader: -> showLoader: ->
@el.find('.zammad-chat-body').html @view('loader')() @el.find('.zammad-chat-body').html @view('loader')()

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long