From 20c73960a739bce6631a83ec9a0cffbdd5940423 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 5 Jan 2016 13:14:44 +0100 Subject: [PATCH] Update maxChatWindows at runtime. --- app/assets/javascripts/app/controllers/chat.coffee | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/app/controllers/chat.coffee b/app/assets/javascripts/app/controllers/chat.coffee index 4eaae253b..235aa02e2 100644 --- a/app/assets/javascripts/app/controllers/chat.coffee +++ b/app/assets/javascripts/app/controllers/chat.coffee @@ -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'