From eb8ff4200be7070eb5feefbf10facf12a987fc1e Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Tue, 24 Nov 2015 13:07:07 +0100 Subject: [PATCH] chat designer: add flat design api description --- .../app/controllers/_channel/chat.coffee | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/_channel/chat.coffee b/app/assets/javascripts/app/controllers/_channel/chat.coffee index 4baa8c539..36d34a3df 100644 --- a/app/assets/javascripts/app/controllers/_channel/chat.coffee +++ b/app/assets/javascripts/app/controllers/_channel/chat.coffee @@ -66,6 +66,12 @@ class App.ChannelChat extends App.Controller type: 'String' description: 'CSS font-size with a unit like 12px, 1.5em. If left to undefined it inherits the font-size of the website.' } + { + name: 'flat' + default: 'false' + type: 'boolean' + description: 'Removes the shadows for a flat look.' + } { name: 'buttonClass' default: "'open-zammad-chat'" @@ -267,6 +273,11 @@ class App.ChannelChat extends App.Controller if parseInt(params.fontSize, 10) > 2 @chat.css('font-size', params.fontSize) @chatBackground.css('background', params.background) + if params.flat is 'on' + @chat.addClass('zammad-chat--flat') + params.flat = true + else + @chat.removeClass('zammad-chat--flat') if @permanent for key, value of @permanent @@ -278,7 +289,7 @@ class App.ChannelChat extends App.Controller # coffeelint: disable=no_unnecessary_double_quotes paramString += ",\n" # coffeelint: enable=no_unnecessary_double_quotes - if value == 'true' || value == 'false' || _.isNumber(value) + if value == true || value == false || _.isNumber(value) paramString += " #{key}: #{value}" else paramString += " #{key}: '#{quote(value)}'"