summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-12-31 15:56:59 -0500
committerRobert Speicher <rspeicher@gmail.com>2016-01-13 11:34:58 -0500
commit12903762d15cef256f579b1ddb692a0254cace52 (patch)
tree476e4666413f40f68f9acb02f97056363fa85847
parent6ae39c2cd1edcc845136739d42baf032120e3ddc (diff)
downloadgitlab-ce-12903762d15cef256f579b1ddb692a0254cace52.tar.gz
Simplify broadcast message JS
Also resets the default example message when the user input is blank.
-rw-r--r--app/assets/javascripts/admin.js.coffee7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/assets/javascripts/admin.js.coffee b/app/assets/javascripts/admin.js.coffee
index e9a26dd7200..eb951f71711 100644
--- a/app/assets/javascripts/admin.js.coffee
+++ b/app/assets/javascripts/admin.js.coffee
@@ -13,15 +13,16 @@ class @Admin
$('.js-toggle-colors-container').toggle()
$('input#broadcast_message_color').on 'input', ->
- previewColor = $('input#broadcast_message_color').val()
+ previewColor = $(@).val()
$('div.broadcast-message-preview').css('background-color', previewColor)
$('input#broadcast_message_font').on 'input', ->
- previewColor = $('input#broadcast_message_font').val()
+ previewColor = $(@).val()
$('div.broadcast-message-preview').css('color', previewColor)
$('textarea#broadcast_message_message').on 'input', ->
- previewMessage = $('textarea#broadcast_message_message').val()
+ previewMessage = $(@).val()
+ previewMessage = "Your message here" if previewMessage.trim() == ''
$('div.broadcast-message-preview span').text(previewMessage)
$('.log-tabs a').click (e) ->