Update maxChatWindows at runtime.
This commit is contained in:
parent
7ba6f6a54d
commit
20c73960a7
1 changed files with 6 additions and 3 deletions
|
@ -213,7 +213,7 @@ class App.CustomerChat extends App.Controller
|
||||||
|
|
||||||
settings: (errors = {}) ->
|
settings: (errors = {}) ->
|
||||||
new Setting(
|
new Setting(
|
||||||
maxChatWindows: @maxChatWindows
|
windowSpace: @
|
||||||
errors: errors
|
errors: errors
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ class ChatWindow extends App.Controller
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
|
|
||||||
@showTimeEveryXMinutes = 1
|
@showTimeEveryXMinutes = 2
|
||||||
@lastTimestamp
|
@lastTimestamp
|
||||||
@lastAddedType
|
@lastAddedType
|
||||||
@isTyping = false
|
@isTyping = false
|
||||||
|
@ -552,7 +552,7 @@ class Setting extends App.ControllerModal
|
||||||
if !preferences.chat.phrase
|
if !preferences.chat.phrase
|
||||||
preferences.chat.phrase = {}
|
preferences.chat.phrase = {}
|
||||||
if !preferences.chat.max_windows
|
if !preferences.chat.max_windows
|
||||||
preferences.chat.max_windows = @maxChatWindows
|
preferences.chat.max_windows = @windowSpace.maxChatWindows
|
||||||
|
|
||||||
App.view('customer_chat/setting')(
|
App.view('customer_chat/setting')(
|
||||||
chats: App.Chat.all()
|
chats: App.Chat.all()
|
||||||
|
@ -566,6 +566,9 @@ class Setting extends App.ControllerModal
|
||||||
|
|
||||||
@formDisable(e)
|
@formDisable(e)
|
||||||
|
|
||||||
|
# update runtime
|
||||||
|
@windowSpace.maxChatWindows = params.chat.max_windows
|
||||||
|
|
||||||
# update user preferences
|
# update user preferences
|
||||||
@ajax(
|
@ajax(
|
||||||
id: 'preferences'
|
id: 'preferences'
|
||||||
|
|
Loading…
Reference in a new issue