Update maxChatWindows at runtime.

This commit is contained in:
Martin Edenhofer 2016-01-05 13:14:44 +01:00
parent 7ba6f6a54d
commit 20c73960a7

View file

@ -213,7 +213,7 @@ class App.CustomerChat extends App.Controller
settings: (errors = {}) ->
new Setting(
maxChatWindows: @maxChatWindows
windowSpace: @
errors: errors
)
@ -256,7 +256,7 @@ class ChatWindow extends App.Controller
constructor: ->
super
@showTimeEveryXMinutes = 1
@showTimeEveryXMinutes = 2
@lastTimestamp
@lastAddedType
@isTyping = false
@ -552,7 +552,7 @@ class Setting extends App.ControllerModal
if !preferences.chat.phrase
preferences.chat.phrase = {}
if !preferences.chat.max_windows
preferences.chat.max_windows = @maxChatWindows
preferences.chat.max_windows = @windowSpace.maxChatWindows
App.view('customer_chat/setting')(
chats: App.Chat.all()
@ -566,6 +566,9 @@ class Setting extends App.ControllerModal
@formDisable(e)
# update runtime
@windowSpace.maxChatWindows = params.chat.max_windows
# update user preferences
@ajax(
id: 'preferences'